Closed
Bug 1013601
Opened 10 years ago
Closed 10 years ago
Add uptimeMillis() to UITelemetry.jsm for getting current timestamp
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 32
People
(Reporter: liuche, Assigned: liuche)
References
Details
Attachments
(2 files)
2.32 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
6.46 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8425913 -
Flags: review?(rnewman)
Comment 3•10 years ago
|
||
Comment on attachment 8425912 [details] [diff] [review] Part 1: handle timestamp in UITelemetry Review of attachment 8425912 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/telemetry/UITelemetry.jsm @@ +83,5 @@ > * and should be registered with addSimpleMeasureFunction. > */ > _simpleMeasureFunctions: {}, > > + _uptimeMillis: function() { Comment the hack! We're attempting to convert between two dissimilar timelines by using a single known point of intersection, and this will fail under clock corrections and pauses. @@ +107,5 @@ > type: "event", > action: aAction, > method: aMethod, > sessions: sessions, > + timestamp: aTimestamp || this._uptimeMillis(), These guards should probably be (aTimestamp == undefined) ? this._uptimeMillis() : aTimestamp Here's why: 0 == undefined false null == undefined true undefined == undefined true
Attachment #8425912 -
Flags: review?(rnewman) → review+
Comment 4•10 years ago
|
||
Comment on attachment 8425913 [details] [diff] [review] Part 2: Change callers from generating timestamps Review of attachment 8425913 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/chrome/content/aboutReader.js @@ -289,5 @@ > this._isReadingListItem = (this._isReadingListItem == 1) ? 0 : 1; > this._updateToggleButton(); > > - // Create a relative timestamp for telemetry > - let uptime = Date.now() - Services.startup.getStartupInfo().linkerInitialized; Keep this one, but make it call the utility function (and kill the comment). The timestamp is more accurate if it's computed prior to the storeArticleInCache callback. Furthermore, I don't think it's bad practice for callers to be specifying timestamps; by all means elide it in the simplest of cases, but this is not a concept I want to hide from developers adding probes -- it's a core concept.
Attachment #8425913 -
Flags: review?(rnewman) → review+
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/e63a1fb3757e https://hg.mozilla.org/integration/fx-team/rev/e563583ad137
Target Milestone: --- → Firefox 31
https://hg.mozilla.org/mozilla-central/rev/e63a1fb3757e https://hg.mozilla.org/mozilla-central/rev/e563583ad137
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: Firefox 31 → Firefox 32
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•