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

Ben Gamari gitlab at gitlab.haskell.org
Thu Oct 15 20:07:00 UTC 2020



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


Commits:
6fbc9242 by Ben Gamari at 2020-10-15T16:06:50-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,21 @@ 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()
+            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/6fbc924259a24271d3aadeb5d58bd2306ed61958

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6fbc924259a24271d3aadeb5d58bd2306ed61958
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/20201015/1e674a90/attachment.html>


More information about the ghc-commits mailing list