File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
compiler/src/dotty/tools/dotc/util Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,17 @@ import collection.mutable
75
75
}
76
76
}
77
77
78
+ final val GroupChar = '/'
79
+
80
+ /** Aggregate all counts of all keys with a common prefix, followed by `:` */
81
+ private def aggregate (): Unit = {
82
+ val groups = hits.keys
83
+ .filter(_.contains(GroupChar ))
84
+ .groupBy(_.takeWhile(_ != GroupChar ))
85
+ for ((prefix, names) <- groups; name <- names)
86
+ hits(s " Total $prefix" ) += hits(name)
87
+ }
88
+
78
89
def maybeMonitored [T ](op : => T )(implicit ctx : Context ): T = {
79
90
if (ctx.settings.YdetailedStats .value) {
80
91
val hb = new HeartBeat ()
@@ -83,6 +94,7 @@ import collection.mutable
83
94
try op
84
95
finally {
85
96
hb.continue = false
97
+ aggregate()
86
98
println()
87
99
println(hits.toList.sortBy(_._2).map{ case (x, y) => s " $x -> $y" } mkString " \n " )
88
100
println(s " uniqueInfo (size, accesses, collisions): ${ctx.base.uniquesSizes}" )
You can’t perform that action at this time.
0 commit comments