Commit 6a7139b9 authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5 stats: provide overall module-level and document-level stats.

parent 38a1f27d
......@@ -485,6 +485,8 @@ class ERP5SiteStats(GenericSiteStats):
append('<h2>Stats per module</h2><table class="stats stats_erp5"><tr>'
'<th rowspan="2" colspan="3">module</th>'
'<th colspan="4" class="overall_right">overall</th>')
module_document_overall = defaultdict(partial(APDEXStats, self.threshold,
None))
filtered_module = defaultdict(partial(defaultdict, partial(
defaultdict, partial(APDEXStats, self.threshold, None))))
filtered_no_module = defaultdict(partial(APDEXStats, self.threshold, None))
......@@ -495,8 +497,10 @@ class ERP5SiteStats(GenericSiteStats):
filtered_is_document_dict = filtered_module[key]
for key, data_dict in is_document_dict.iteritems():
filtered_data_dict = filtered_is_document_dict[key]
module_document_apdex = module_document_overall[key]
for date, value in data_dict.iteritems():
filtered_data_dict[stat_filter(date)].accumulateFrom(value)
module_document_apdex.accumulateFrom(value)
column_set.update(filtered_data_dict)
column_list = sorted(column_set)
for date in column_list:
......@@ -512,6 +516,7 @@ class ERP5SiteStats(GenericSiteStats):
append(data_total.asHTML(self.threshold, True))
for date in column_list:
append(data_dict[date].asHTML(self.threshold))
return data_total
def hiddenGraph(data_dict, title):
append('<td class="text group_right hidden_graph">')
data = getDataPoints(data_dict)
......@@ -541,7 +546,16 @@ class ERP5SiteStats(GenericSiteStats):
append('</tr>')
append('<tr class="group_top group_bottom"><th colspan="2">(none)</th>')
hiddenGraph(self.no_module, '(none)')
apdexAsColumns(filtered_no_module)
no_module_overall = apdexAsColumns(filtered_no_module)
append('</tr></table><h2>Per-level overall</h2><table class="stats"><tr>'
'<th>level</th>')
append(APDEXStats.asHTMLHeader())
append('</tr><tr><th>top</th>')
append(no_module_overall.asHTML(self.threshold))
append('</tr><tr><th>module</th>')
append(module_document_overall[False].asHTML(self.threshold))
append('</tr><tr><th>document</th>')
append(module_document_overall[True].asHTML(self.threshold))
append('</tr></table>')
append(super(ERP5SiteStats, self).asHTML(date_format,
placeholder_delta, graph_period, encoding, stat_filter=stat_filter))
......
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