Commit a004f2cb authored by Vincent Pelletier's avatar Vincent Pelletier

Color apdex column.

parent a2bb7274
...@@ -294,9 +294,12 @@ class ERP5SiteStats(GenericSiteStats): ...@@ -294,9 +294,12 @@ class ERP5SiteStats(GenericSiteStats):
'<th>max (s)</th>') '<th>max (s)</th>')
append('</tr>') append('</tr>')
def apdexStatsAsHtml(data): def apdexStatsAsHtml(data):
return '<td>%i%%</td><td>%s</td><td class="%s">%.2f</td>' \ apdex = data.getApdex()
'<td class="%s">%.2f</td>' % ( return '<td style="color: #%s; background-color: #%s">%i%%</td>' \
data.getApdex() * 100, '<td>%s</td><td class="%s">%.2f</td><td class="%s">%.2f</td>' % (
(apdex < .5 and 'f' or '0') * 3,
('%x' % (apdex * 0xf)) * 3,
apdex * 100,
data.hit, data.hit,
getClassForDuration(data.getAverage(), self.threshold), getClassForDuration(data.getAverage(), self.threshold),
data.getAverage() / US_PER_S, data.getAverage() / US_PER_S,
......
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