lib/fnordmetric/gauges/timeseries_gauge.rb in fnordmetric-0.9.7 vs lib/fnordmetric/gauges/timeseries_gauge.rb in fnordmetric-1.0.0

- old
+ new

@@ -11,15 +11,10 @@ end @calculate = @opts[:calculate].to_sym end @calculate ||= :sum - - if @calculate == :average - @calculate_proc = lambda{ |c,d| d > 0 ? (c/d.to_f).round(2) : 0 } - else - @calculate_proc = lambda{ |c,d| c } - end + @calculate_proc = lambda{ |c,d| d > 0 ? (c/d.to_f).round(2) : c } end def render(namespace, event) @interval = parse_interval(event["interval"]) colors = FnordMetric::COLORS.dup