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