Commit bb8119dd authored by Austin Clements's avatar Austin Clements

benchstat: omit 0 values from geomean

This makes the geomean undefined (or zero, depending on who you ask).
Since these usually come from counts, it's more informative to just
omit the benchmark.

Change-Id: Ia426955784cf12fea19b3d5e51a49a436cbc81c6
Reviewed-on: https://go-review.googlesource.com/38092Reviewed-by: default avatarQuentin Smith <quentin@golang.org>
parent 4c54bbdd
......@@ -141,7 +141,13 @@ func addGeomean(c *Collection, t *Table, unit string, delta bool) {
var means []float64
for _, key.Benchmark = range c.Benchmarks {
m := c.Metrics[key]
if m != nil {
// Omit 0 values from the geomean calculation,
// as these either make the geomean undefined
// or zero (depending on who you ask). This
// typically comes up with things like
// allocation counts, where it's fine to just
// ignore the benchmark.
if m != nil && m.Mean != 0 {
means = append(means, m.Mean)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment