Closed
Bug 1458203
Opened 6 years ago
Closed 6 years ago
telemetry.js: Rename all log* methods
Categories
(DevTools :: General, enhancement, P2)
Tracking
(firefox62 fixed)
RESOLVED
FIXED
Firefox 62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: miker, Assigned: miker)
References
Details
Attachments
(1 file, 1 obsolete file)
log: calls T.getHistogramById().add() logKeyed: calls T.getKeyedHistogramById().add() logScalar: calls T.scalarSet() logCountScalar: calls T.scalarAdd() logKeyedScalar: calls T.keyedScalarAdd() All the low level methods are renamed to match the real method names from Services.telemetry. Example: log is replaced by getHistogramById. The caller is responsible for calling add() afterwards. In case the histogram doesn't exist, we can return a mock { add: () => {} }.
Assignee | ||
Updated•6 years ago
|
Has Regression Range: --- → irrelevant
Has STR: --- → irrelevant
Assignee | ||
Comment 1•6 years ago
|
||
logOncePerBrowserVersion: complex method to check if a probe was already logged, ends up calling T.getHistogramById().add()
Assignee | ||
Comment 2•6 years ago
|
||
Creating `add: () => {}` for undefined histograms would mask bugs so we will not be doing this.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1987fbb1ad6b9658d85f08bacec660e06a1e75d
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8973163 -
Attachment is obsolete: true
Assignee | ||
Comment 6•6 years ago
|
||
mozreview-review |
Comment on attachment 8973193 [details] Bug 1458203 - telemetry.js: Rename all log* methods https://reviewboard.mozilla.org/r/241686/#review247510 try is green: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1987fbb1ad6b9658d85f08bacec660e06a1e75d&group_state=expanded
Comment 7•6 years ago
|
||
mozreview-review |
Comment on attachment 8973193 [details] Bug 1458203 - telemetry.js: Rename all log* methods https://reviewboard.mozilla.org/r/241686/#review247594 That's great! Thanks a lot for the cleanup Mike. ::: devtools/client/shared/telemetry.js:286 (Diff revision 1) > - return; > + > + if (histogramId) { > + try { > + histogram = Services.telemetry.getHistogramById(histogramId); > + } catch (e) { > + dump(`Warning: An attempt was made to write to the ${histogramId} ` + I don't feel strongly about this, but if we want to avoid the caller to throw when calling ".add()" on this histogram, we could return a mock histogram = { add : () => {} }; Up to you. Same comment for getKeyedHistogramById
Attachment #8973193 -
Flags: review?(jdescottes) → review+
Comment 8•6 years ago
|
||
(In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from comment #2) > Creating `add: () => {}` for undefined histograms would mask bugs so we will > not be doing this. Had not seen this comment. I don't really follow the reasoning, the current try/catch around the whole method has the exact same impact.
Assignee | ||
Comment 9•6 years ago
|
||
(In reply to Julian Descottes [:jdescottes][:julian] from comment #8) > (In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from > comment #2) > > Creating `add: () => {}` for undefined histograms would mask bugs so we will > > not be doing this. > > Had not seen this comment. I don't really follow the reasoning, the current > try/catch around the whole method has the exact same impact. Ah, you mean to stop failed telemetry breaking stuff... I will change all methods to prevent throwing but dump a warning.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 14•6 years ago
|
||
Pushed by mratcliffe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d555b3a047d1 telemetry.js: Rename all log* methods r=jdescottes
![]() |
||
Comment 15•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d555b3a047d1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•