Class: MetricFu::FlogGrapher
- Defined in:
- lib/graphs/flog_grapher.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Grapher
Grapher::BLUFF_DEFAULT_OPTIONS, Grapher::BLUFF_GRAPH_SIZE
Constants included from GchartGrapher
GchartGrapher::COLORS, GchartGrapher::GCHART_GRAPH_SIZE, GchartGrapher::NUMBER_OF_TICKS
Instance Attribute Summary collapse
-
#flog_average ⇒ Object
Returns the value of attribute flog_average.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#top_five_percent_average ⇒ Object
Returns the value of attribute top_five_percent_average.
Instance Method Summary collapse
- #get_metrics(metrics, date) ⇒ Object
-
#initialize ⇒ FlogGrapher
constructor
A new instance of FlogGrapher.
Methods inherited from Grapher
Methods included from GchartGrapher
Constructor Details
#initialize ⇒ FlogGrapher
Returns a new instance of FlogGrapher.
5 6 7 8 9 10 |
# File 'lib/graphs/flog_grapher.rb', line 5 def initialize super @flog_average = [] @labels = {} @top_five_percent_average =[] end |
Instance Attribute Details
#flog_average ⇒ Object
Returns the value of attribute flog_average.
3 4 5 |
# File 'lib/graphs/flog_grapher.rb', line 3 def flog_average @flog_average end |
#labels ⇒ Object
Returns the value of attribute labels.
3 4 5 |
# File 'lib/graphs/flog_grapher.rb', line 3 def labels @labels end |
#top_five_percent_average ⇒ Object
Returns the value of attribute top_five_percent_average.
3 4 5 |
# File 'lib/graphs/flog_grapher.rb', line 3 def top_five_percent_average @top_five_percent_average end |
Instance Method Details
#get_metrics(metrics, date) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/graphs/flog_grapher.rb', line 12 def get_metrics(metrics, date) if metrics && metrics[:flog] @top_five_percent_average.push(calc_top_five_percent_average(metrics)) @flog_average.push(metrics[:flog][:average]) @labels.update( { @labels.size => date }) end end |