[Git][ghc/ghc][wip/T18838] testsuite: Sort metrics by metric type

Ben Gamari gitlab at gitlab.haskell.org
Thu Oct 15 01:32:23 UTC 2020



Ben Gamari pushed to branch wip/T18838 at Glasgow Haskell Compiler / GHC


Commits:
72965792 by Ben Gamari at 2020-10-14T21:32:15-04:00
testsuite: Sort metrics by metric type

Closes #18838.

- - - - -


1 changed file:

- testsuite/driver/runtests.py


Changes:

=====================================
testsuite/driver/runtests.py
=====================================
@@ -457,7 +457,20 @@ else:
     if config.baseline_commit:
         print('Performance baseline: %s\n' % config.baseline_commit)
     if any(t.metrics):
-        tabulate_metrics(t.metrics)
+        # Group metrics by metric type
+        groups = {} # type: Dict[MetricName, List[PerfMetric]]
+        for m in t.metrics:
+            if m.stat.metric not in groups:
+                groups[m.stat.metric] = []
+
+            groups[m.stat.metric].append(m)
+
+        for metric_name, stats in groups.items():
+            heading = 'Metrics: %s' % metric_name
+            print(heading)
+            print('-' * len(heading))
+            print()
+            tabulate_metrics(stats)
     else:
         print("\nNone collected.")
     print("")



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72965792deb4c37dbfbe1a27b6e5125077dac3ab

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72965792deb4c37dbfbe1a27b6e5125077dac3ab
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201014/064b5d9d/attachment.html>


More information about the ghc-commits mailing list