--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/fancy.html Sun Feb 07 22:32:30 2016 +0800
+ <title>hgperfcheck{% if changesets %} (rev {{ changesets[0]['rev'] }} and earlier){% end %}</title>
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.css" rel="stylesheet" type="text/css">
+ <style type="text/css">
+ font-family: monospace;
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.14/d3.min.js"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.js"></script>
+ <a href="{{ setrev() }}">back to tip</a>
+ {% set prevrev = changesets[0]['rev'] + 120 if changesets else None %}
+ {% if prevrev %}<a href="{{ setrev(prevrev) }}">prev page</a>{% end %}
+ {% set nextrev = changesets[-1]['rev'] - 1 if changesets else None %}
+ {% if nextrev > -1 %}<a href="{{ setrev(nextrev) }}">next page</a>{% end %}
+ <span style="color: #777;">
+ hover things for a tooltip; red means slow, green means fast; first
+ color and time means without .hg/cache, second means with .hg/cache.
+ {% for mark, desc in marks.items() %}
+ -<a href="{{ setmarks(remove=mark) }}" title="{{ desc }}">{{ mark }}</a>
+ {% for mark, desc in moremarks.items() %}
+ +<a href="{{ setmarks(add=mark) }}" title="{{ desc }}">{{ mark }}</a>
+ *<a href="{{ setmarks() }}">all</a>
+ <a href="{{ setrev() }}">back to tip</a>
+ {% if prevrev %}<a href="{{ setrev(prevrev) }}">prev page</a>{% end %}
+ {% if nextrev > -1 %}<a href="{{ setrev(nextrev) }}">next page</a>{% end %}
+ <script type="application/json" id="data">{% raw json_encode(data) %}</script>
+ var chart = c3.generate({
+ tooltip: {format: {title: function(x) { return x; }}},
+ data: JSON.parse(document.getElementById('data').firstChild.nodeValue)
--- a/viewer.py Sat Feb 06 20:47:42 2016 +0800
+++ b/viewer.py Sun Feb 07 22:32:30 2016 +0800
class ResultsHandler(BaseHandler):
+ def get(self, page, ext):
if self.check_etag_header():
self.render('results.html', **context)
+ changesets = self.getchangesets()
+ marks, moremarks = self.getmarks()
+ results, _ = self.getresults(changesets, marks=marks, colors=False)
+ for cset in changesets:
+ item = {'rev': cset['rev']}
+ values = results.get(cset['node'], {}).get(mark, None)
+ 'keys': {'x': 'rev', 'value': marks.keys()}
+ 'changesets': changesets,
+ 'moremarks': moremarks,
+ 'setmarks': self.setmarks(marks),
+ self.render('fancy.html', **context)
def green_to_red((low, high), value):
hue = (value - low) / (high - low) if high != low else 0.5
URLSpec(r'/', IndexHandler),
- URLSpec(r'/results\.(html|tsv|asc)', ResultsHandler),
+ URLSpec(r'/(results)\.(html|tsv|asc)', ResultsHandler),
+ URLSpec(r'/(fancy)\.(html)', ResultsHandler),