Commit 278332c9 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix ponderated average computation

Also, fix default value inversion.
parent 157f4ca6
......@@ -455,10 +455,10 @@ class ERP5SiteStats(GenericSiteStats):
date_dict = asDict(super(ERP5SiteStats, self).getApdexData())
for date, (apdex, hit) in asDict(getDataPoints(self.no_module)
).iteritems():
super_apdex, super_hit = date_dict.get(date, (0, 100))
super_apdex, super_hit = date_dict.get(date, (100, 0))
new_hit = hit + super_hit
if super_hit:
new_apdex = super_apdex * new_hit / super_hit + apdex * new_hit / hit
new_apdex = super_apdex * super_hit / new_hit + apdex * hit / new_hit
date_dict[date] = (new_apdex, new_hit)
return sorted(((date, apdex, hit)
for date, (apdex, hit) in date_dict.iteritems()), key=ITEMGETTER0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment