Commits


Jesse Rosenstock authored and GitHub committed e73915667c2
State: Initialize counters with kAvgIteration in constructor (#1652) * State: Initialize counters with kAvgIteration in constructor Previously, `counters` was updated in `PauseTiming()` with `counters[name] += Counter(measurement, kAvgIteration)`. The first `counters[name]` call inserts a counter with no flags. There is no `operator+=` for `Counter`, so the insertion is done by converting the `Counter` to a `double`, then constructing a `Counter` to insert from the `double`, which drops the flags. Pre-insert the `Counter` with the correct flags, then only update `Counter::value`. Introduced in 1c64a36 ([perf-counters] Fix pause/resume (#1643)). * perf_counters_test.cc: Don't divide by iterations Perf counters are now divided by iterations, so dividing again in the test is wrong. * State: Fix shadowed param error * benchmark.cc: Fix clang-tidy error --------- Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>