--- a/templates/results.html Tue May 05 23:19:13 2015 +0800
+++ b/templates/results.html Tue May 05 23:27:29 2015 +0800
<td class="hint"><div title="{{ cset['desc'] }}">{{ cset['desc'].partition('\n')[0] }}</div></td>
{% set result = results.get(cset['node'], {}) %}
- {% set value, color = result.get(mark, (None, None)) %}
+ {% set v1, c1, v2, c2 = result.get(mark, (None, None, None, None)) %}
- <span style="{% if color is not None %}background-color: rgb{{ str(color) }}{% end %}"> </span>
- <span title="{{ value }}">{{ '{:.2f}s'.format(value) if value is not None else 'N/A' }}</span>
+ <span style="{% if c1 is not None %}background-color: rgb{{ str(c1) }}{% end %}"> </span>{#
+ #}<span style="{% if c2 is not None %}background-color: rgb{{ str(c2) }}{% end %}"> </span>
+ <span title="w/o .hg/cache: {{ v1 }}">{{ '{:.2f}s'.format(v1) if v1 is not None else '-' }}</span>{#
+ #}<span title="with .hg/cache: {{ v2 }}">{{ '{:.2f}s'.format(v2) if v2 is not None else '-' }}</span>
--- a/viewer.py Tue May 05 23:19:13 2015 +0800
+++ b/viewer.py Tue May 05 23:27:29 2015 +0800
+ def getchangesets(self):
rev = self.get_argument('rev', 'tip')
+ return getinfo('first(%s:0, %d)' % (rev, revcount))
+ def getresults(self, changesets):
- mark: self.conn.execute(
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
- (mark, False)).fetchone()
+ 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
+ (mark, False)).fetchone()
+ 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
+ (mark, True)).fetchone()
- changesets = getinfo('first(%s:0, %d)' % (rev, revcount))
resultsq = self.conn.execute(
- 'SELECT mark, time FROM results WHERE node = ? AND cache = ?',
- for mark, time in resultsq:
- color = green_to_red(limits[mark], time) if time is not None else None
- results.setdefault(node, {})[mark] = (time, color)
+ 'SELECT mark, time, cache FROM results WHERE node = ?',
+ for mark, time, cache in resultsq:
+ results.setdefault(node, {}).setdefault(mark, [None, None, None, None])
+ color = green_to_red(limits[mark][0:2], time) if time is not None else None
+ results[node][mark][0:2] = [time, color]
+ color = green_to_red(limits[mark][2:4], time) if time is not None else None
+ results[node][mark][2:4] = [time, color]
+ changesets = self.getchangesets()
+ results = self.getresults(changesets)
return changesets, results