Closed
Bug 1158251
Opened 10 years ago
Closed 10 years ago
Sub-session histograms should be cloned before adding to them
Categories
(Toolkit :: Telemetry, defect)
Tracking
()
RESOLVED
FIXED
mozilla40
People
(Reporter: vladan, Assigned: Dexter)
References
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Dexter
:
review+
|
Details | Diff | Splinter Review |
STR:
1. Launch Firefox (Nightly 40 & Aurora 39 are both affected), don't do anything that would trigger a new Telemetry subsession
2. Open about:telemetry
3. Compare the values of any subsession and full-session histograms, e.g. GC_MS
The subsession histogram will have 1 more value than the full-session histogram
Updated•10 years ago
|
status-firefox39:
--- → affected
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → alessio.placitelli
Assignee | ||
Comment 1•10 years ago
|
||
From my debug log:
**** DEBUG Adding to GC_MS (1)
**** DEBUG Cloning GC_MS (2)
**** DEBUG Adding to sub#GC_MS (3)
We're adding to the existing histogram, then cloning it to create the subsession histogram, then adding to the subsession histogram. Step (1) should happen after creating the subsession histogram.
Keyed histograms already behave like that.
Attachment #8597950 -
Flags: review?(gfritzsche)
Updated•10 years ago
|
Attachment #8597950 -
Attachment is patch: true
Comment 2•10 years ago
|
||
Comment on attachment 8597950 [details] [diff] [review]
bug1158251
Review of attachment 8597950 [details] [diff] [review]:
-----------------------------------------------------------------
Can we have test-coverage for this?
::: toolkit/components/telemetry/Telemetry.cpp
@@ +1085,5 @@
> if (Histogram* subsession = GetSubsessionHistogram(histogram)) {
> subsession->Add(value);
> }
> #endif
> + // It is safe to add to the histogram now: the subsession histogram was already
Nit: Line-break before this.
Attachment #8597950 -
Flags: review?(gfritzsche) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Adds test coverage.
Attachment #8597950 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8597978 -
Flags: review?(gfritzsche)
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Updated•10 years ago
|
Attachment #8597978 -
Attachment is patch: true
Comment 4•10 years ago
|
||
Comment on attachment 8597978 [details] [diff] [review]
bug1158251 - v2
Review of attachment 8597978 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
@@ +613,5 @@
> let h = Telemetry.getHistogramById(ID);
> let flag = Telemetry.getHistogramById(FLAG);
>
> + // Instantiate the subsession histogram through |add| and make they match.
> + h.add(1);
This only instantiates the subsession histogram on first use (not after being cleared).
I don't think we have a useful way to assert this scenario, so we should either:
* make it very clear in a comment that this should be the first use of TELEMETRY_TEST_COUNT in this file
* or put in a separate test file
Also, are keyed histograms prone to the same issue?
Attachment #8597978 -
Flags: review?(gfritzsche)
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8597978 -
Attachment is obsolete: true
Attachment #8598011 -
Flags: review?(gfritzsche)
Comment 6•10 years ago
|
||
Comment on attachment 8598011 [details] [diff] [review]
bug1158251.patch - v3
Review of attachment 8598011 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
@@ +614,5 @@
> let flag = Telemetry.getHistogramById(FLAG);
>
> + // Instantiate the subsession histogram through |add| and make sure they match.
> + // This MUST be the first use of "TELEMETRY_TEST_COUNT" in this file, otherwise
> + // |add| will not instantiate the histogram.
Ok, last request:
Lets move this check into say test_instantiate() and call this as the very first test function from run_test().
This should make it much less likely to be a footgun.
Attachment #8598011 -
Flags: review?(gfritzsche) → review+
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8598011 -
Attachment is obsolete: true
Attachment #8598026 -
Flags: review+
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #4)
>
> Also, are keyed histograms prone to the same issue?
No, they behaved correctly already.
Assignee | ||
Comment 9•10 years ago
|
||
Fixes the broken Android tests.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a6fd09cea65f
Attachment #8598026 -
Attachment is obsolete: true
Attachment #8598684 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 11•10 years ago
|
||
Rebased
Attachment #8598684 -
Attachment is obsolete: true
Attachment #8599118 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Updated•10 years ago
|
Summary: Sub-session histograms are double-counting measurements? → Sub-session histograms should be cloned before adding to them
Updated•10 years ago
|
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•