metrics: add per-version cumulative counters
This adds counters that accumulate some measurement across an OS version;
they are reset at version updates, but reported more frequently (for instance,
Such counts could be obtained by pseudonymous dremel queries, but this is
The code replaces the "tag" datum in the counters with two tags: a
"report tag" and a "reset tag". When the report
tag changes, the count is reported but not reset. When the reset tag
changes, the count is both reported and reset.
This also adds one usage of the new counter which tracks the total
number of kernel crashes since the most recent OS version update.
The state machine in counter.cc changes a bit because it's no longer
true that a counter is reset after reporting it. That logic is
still rather confusing, and could use a rewrite.
TEST=ran on target under various situations
Reviewed-by: Daniel Erat <email@example.com>
Commit-Queue: Luigi Semenzato <firstname.lastname@example.org>
Tested-by: Luigi Semenzato <email@example.com>
8 files changed