New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 758796 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Create a macro for counter histograms.

Project Member Reported by holte@chromium.org, Aug 25 2017

Issue description

It seems like there is a fairly frequent desire for a histogram which is just a counter, e.g. a single bucket which is just incremented to count how many times a single thing happens. This usually shows up as a histograms which always records the sample "1", sometimes in a numeric histogram.

We should probably just add a macro explicitly for counters, so that cases of this are easier to support.

maybe UMA_HISTOGRAM_COUNTER(name), documented as
<histogram name=".." enum="Counter">

 
If we do add this macro, I'd be inclined to add a big comment above it along the lines of "Thinking of using this macro?  Probably don't".  That is, counter histograms are mostly an anti-pattern, with a few exceptions.  For the most part, it's much better to implement metrics that have a built-in baseline.

Comment 2 by holte@chromium.org, Sep 1 2017

Components: Internals>Metrics>UMA
Components: -Internals>Metrics
Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
I suppose that I'm not really opposed to landing this, perhaps named UMA_HISTOGRAM_HIT_COUNTER, to match the existing BooleanHit enum that we have defined in enums.xml (and typically use for such counter histograms).  I would still want to include a big caveat above the macro, since it's more often appropriate to include a baseline with any given metric.

Sign in to add a comment