Closed Bug 1121785 Opened 10 years ago Closed 7 years ago

JSHistogram_Add should fail if an argument is given for a "count" histogram

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: MattN, Unassigned)

References

Details

I thought that the argument to a non-keyed "count" histogram allow me to increment/set the count that gets reported but instead the argument gets ignored and we always increment by 1 for this kind of histogram. This seems like a footgun as-is especially since most documentation shows an argument to .add() but it's actually not required for some probes types.
In bug 1069873 i think we didn't really want to block the .add(arg) to stay with the common, documented syntax. I'd like us to end up with the solution that leads to the least usage issues though, whatever that is exactly.
Usage has solidified around being able to add to count histograms by any step value the user desires, so we won't be closing it off. We also prefer uint scalars these days instead of count histograms, so we're not likely to make changes to their behaviour.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Are you saying that comment 0 is no longer correct meaning we don't ignore the argument? If so, this should be WORKSFORME
Flags: needinfo?(chutten)
Good catch, I misread the bug. According to my read of JS_Histogram_Add, we coerce the arg to a uint32_t and then accumulate that way. And a quick little JS in about:telemetry confirms: Telemetry.getHistogramById("TELEMETRY_TEST_COUNT").add(10); Telemetry.getHistogramById("TELEMETRY_TEST_COUNT").snapshot().sum <- 10
Flags: needinfo?(chutten)
Resolution: WONTFIX → WORKSFORME
Thanks for clarifying
You need to log in before you can comment on or make changes to this bug.