Commit 5eb90fec authored by Vincent Pelletier's avatar Vincent Pelletier

Fade ERP5 stats for cell groups which have no hit.

parent e804ffc3
......@@ -91,16 +91,26 @@ def getApdexStatsAsHtml(data, threshold):
apdex = data.getApdex()
average = data.getAverage()
maximum = data.getMax()
return '<td style="%s">%i%%</td>' \
'<td>%s</td><td class="%s">%.2f</td><td class="%s">%.2f</td>' % (
getApdexStyle(apdex),
apdex * 100,
data.hit,
getClassForDuration(average, threshold),
average,
getClassForDuration(maximum, threshold),
maximum,
)
hit = data.hit
if hit:
extra_class = ''
apdex_style = getApdexStyle(apdex)
else:
extra_class = 'no_hit'
apdex_style = ''
return '<td style="%(apdex_style)s" class="%(extra_class)s">%(apdex)i%%' \
'</td><td class="%(extra_class)s">%(hit)s</td>' \
'<td class="%(average_class)s %(extra_class)s">%(average).2f</td>' \
'<td class="%(max_class)s %(extra_class)s">%(max).2f</td>' % {
'extra_class': extra_class,
'apdex_style': apdex_style,
'apdex': apdex * 100,
'hit': hit,
'average_class': getClassForDuration(average, threshold),
'average': average,
'max_class': getClassForDuration(maximum, threshold),
'max': maximum,
}
APDEX_TABLE_HEADERS = ''.join('<th>' + x + '</th>' for x in (
'apdex', 'hits', 'avg (s)', 'max (s)'))
......@@ -604,6 +614,7 @@ def main():
'.stats th { text-align: center; } '
'.stats td { text-align: right; } '
'.stats th.text, .stats td.text { text-align: left; } '
'.stats td.no_hit { color: #ccc; } '
'table.stats { border-collapse: collapse; } '
'.problem { background-color: #f00; color: white; } '
'.warning { background-color: #f80; color: white; } '
......
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