changeset 41190:c3e5ce3a9483

contrib: update window title when possible in perf-revlog-write-plot.py This is useful when comparing multiple graphs.
author Boris Feld <boris.feld@octobus.net>
date Thu, 03 Jan 2019 22:13:28 +0100
parents 99125b7fb93e
children 93c2beb9047f
files contrib/perf-utils/perf-revlog-write-plot.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf-utils/perf-revlog-write-plot.py	Fri Jan 11 12:40:16 2019 -0800
+++ b/contrib/perf-utils/perf-revlog-write-plot.py	Thu Jan 03 22:13:28 2019 +0100
@@ -22,7 +22,7 @@
 )
 
 
-def plot(data):
+def plot(data, title=None):
     items = {}
     re_title = re.compile(r'^revisions #\d+ of \d+, rev (\d+)$')
     for item in data:
@@ -108,6 +108,8 @@
         else:
             legline.set_alpha(0.2)
         fig.canvas.draw()
+    if title is not None:
+        fig.canvas.set_window_title(title)
     fig.canvas.mpl_connect('pick_event', onpick)
 
     plt.show()
@@ -119,7 +121,7 @@
     if len(sys.argv) > 1:
         print('reading from %r' % sys.argv[1])
         with open(sys.argv[1], 'r') as fp:
-            plot(json.load(fp))
+            plot(json.load(fp), title=sys.argv[1])
     else:
         print('reading from stdin')
         plot(json.load(sys.stdin))