Class: MetricFu::StatsGrapher
- Defined in:
- lib/metric_fu/metrics/stats/grapher.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#loc_counts ⇒ Object
Returns the value of attribute loc_counts.
-
#lot_counts ⇒ Object
Returns the value of attribute lot_counts.
Attributes inherited from Grapher
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
- #get_metrics(metrics, date) ⇒ Object
-
#initialize ⇒ StatsGrapher
constructor
A new instance of StatsGrapher.
- #output_filename ⇒ Object
- #title ⇒ Object
Methods inherited from Grapher
#date, get_grapher, #graph!, graphers
Constructor Details
#initialize ⇒ StatsGrapher
Returns a new instance of StatsGrapher.
10 11 12 13 14 15 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 10 def initialize super self.loc_counts = [] self.lot_counts = [] self.labels = {} end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
4 5 6 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 4 def labels @labels end |
#loc_counts ⇒ Object
Returns the value of attribute loc_counts.
4 5 6 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 4 def loc_counts @loc_counts end |
#lot_counts ⇒ Object
Returns the value of attribute lot_counts.
4 5 6 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 4 def lot_counts @lot_counts end |
Class Method Details
.metric ⇒ Object
6 7 8 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 6 def self.metric :stats end |
Instance Method Details
#data ⇒ Object
29 30 31 32 33 34 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 29 def data [ ["LOC", @loc_counts.join(",")], ["LOT", @lot_counts.join(",")], ] end |
#get_metrics(metrics, date) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 17 def get_metrics(metrics, date) if metrics && metrics[:stats] loc_counts.push(metrics[:stats][:codeLOC].to_i) lot_counts.push(metrics[:stats][:testLOC].to_i) labels.update(labels.size => date) end end |
#output_filename ⇒ Object
36 37 38 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 36 def output_filename "stats.js" end |
#title ⇒ Object
25 26 27 |
# File 'lib/metric_fu/metrics/stats/grapher.rb', line 25 def title "Stats: LOC & LOT" end |