From 0ea767707f17c1a3a8fe334a5f3169c25872ed4c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 8 Sep 2015 14:55:13 +0200 Subject: [PATCH] Fixed average calculation. --- lib/stats/ticket_load_measure.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/stats/ticket_load_measure.rb b/lib/stats/ticket_load_measure.rb index 5b53f42b4..cf4ed5c8c 100644 --- a/lib/stats/ticket_load_measure.rb +++ b/lib/stats/ticket_load_measure.rb @@ -24,7 +24,7 @@ class Stats::TicketLoadMeasure load_measure_precent = ( count.to_f / (total.to_f/100) ).round(1) end { - used_for_average: load_measure_precent, + used_for_average: count, average_per_agent: average, percent: load_measure_precent, state: state, @@ -42,7 +42,7 @@ class Stats::TicketLoadMeasure return result end - in_percent = ( result[:used_for_average].to_f / (result[:average_per_agent].to_f/100) ).round(1) + in_percent = ( result[:used_for_average].to_f / (result[:total].to_f/100) ).round(1) result[:average_per_agent_in_percent] = in_percent if in_percent >= 90 result[:state] = 'supergood'