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

Issue 651950 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Rethink over/underflow / Suggested inputs to linear histograms lead to unbalanced buckets

Project Member Reported by rkaplow@chromium.org, Sep 30 2016

Issue description

There are two heavily related issues here, but I'm bundling them in the same bug.

The primary issue is our use of under/overflow buckets are not very intuitive. In general, we use the 0-1 bucket as an underflow, and bucket_max->int_max as an overflow. One flaw with this is real data can fall in the 0-1 range, and this can get mixed up with incorrect data, in theory. 
For both cases, it would be nice if we supported this a bit better on the dashboard, and gave special labels for real under/overflow data.

A related issue is that this can be confusing to work with in Chromium. Since we mostly use macros, there isn't much of a problem, but our suggestions for inputs to the FactoryGet for LinearHistogram is incorrect.


First, note our suggestion:
https://codesearch.chromium.org/chromium/src/base/metrics/histogram_base.cc?q=LinearHistogram+factoryget&sq=package:chromium&l=143&dr=C
This looks like we want min=1, max=MAX+1, num_buck=NUM_BUCK+1

Here are a couple of bad cases here:
https://codesearch.chromium.org/chromium/src/base/metrics/persistent_memory_allocator.cc?q=persistent+histograms+factoryget+21&sq=package:chromium&l=413&dr=C

Note this is even in base/metrics. The intention clearly was to get a percentage (1-100) with bucket sizes of 5. However, if you look at the data, we see ranges of 5 and 6. The problem is the logic itself assumed both under and overflow buckets includes, 
https://codesearch.chromium.org/chromium/src/base/metrics/histogram.cc?sq=package:chromium&dr=CSs&rcl=1475234468&l=895
(see bucket_count - 2). If we had set it to be 22 and not 21, then we would get ranges of 5, going from 1-101. This is better, but still we would prefer ranges 0-100, and then under/overflow buckets...

Another sample issue:
https://codesearch.chromium.org/chromium/src/content/renderer/pepper/pepper_plugin_instance_metrics.cc?q=LinearHistogram::FactoryGet&sq=package:chromium&l=60&dr=C
Similar, this expected 100 bucket of size 5, but we see a mix of length 5 and 6 in the data.

Inconsistent sizes in linear histogram is pretty bad since (in these examples), a casual viewing of the histogram will show every Nth bucket have a 20% increase in data. Exponential histograms aren't as sensitive but we still have the under/overflow issues there.






 
Labels: OS-All
I reviewed a case where someone wanted a percent histogram with bucket size of 5.  I told them to use an enum histogram, divide their percept by 5, and put an appropriate label in histograms.xml (units="%/5" I think).

I think this should be our general temporary solution going forward.

The better solution would be to allow setting a min value to 0 (and thus the underflow bucket, if any, would be things less than 0).  Right now min=0 violates some assumptions in the code, assumptions that are checked by DCHECKs.  Then it will be much easier to reason about the number of buckets and where the boundaries fall.

I think it's quite uncommon for histograms to want to dump underflow data into a single bucket, fwiw.  Usually I recommend designing the metric in a different way, if there is any anticipation of underflow data.
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 4 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Still valid.
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 5

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment