Patchwork [3,of,9,V3] perf: only display the total time for perfrevlogwrite if quiet

login
register
mail settings
Submitter Boris Feld
Date Nov. 6, 2018, 11:27 a.m.
Message ID <24f71fdc0551dffb59ad.1541503651@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/36418/
State Accepted
Headers show

Comments

Boris Feld - Nov. 6, 2018, 11:27 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1541462254 -3600
#      Tue Nov 06 00:57:34 2018 +0100
# Node ID 24f71fdc0551dffb59ad2c29c1183d747122ab64
# Parent  fd1ce4514534dc539c2f00afb4340e0ae575d30f
# EXP-Topic revlog-perf
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 24f71fdc0551
perf: only display the total time for perfrevlogwrite if quiet

This provide a simple way to get an overview of the total performance.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1632,10 +1632,11 @@  def perfrevlogwrite(ui, repo, file_=None
         ("99%", resultcount * 99 // 100),
         ("max", -1),
     ]
-    for name, idx in relevants:
-        data = results[idx]
-        title = '%s of %d, rev %d' % (name, resultcount, data[0])
-        formatone(fm, data[1], title=title, displayall=displayall)
+    if not ui.quiet:
+        for name, idx in relevants:
+            data = results[idx]
+            title = '%s of %d, rev %d' % (name, resultcount, data[0])
+            formatone(fm, data[1], title=title, displayall=displayall)
 
     # XXX summing that many float will not be very precise, we ignore this fact
     # for now