Open Bug 1375894 Opened 7 years ago Updated 2 years ago

Replace "new Date" usages with monotonic one.

Categories

(Toolkit :: Telemetry, enhancement, P4)

enhancement

Tracking

()

Tracking Status
firefox57 --- fix-optional

People

(Reporter: katejimmelon, Unassigned)

References

Details

`Date` is not necessarily monotonic - it can jump forward or backward with the system clock. We can use `Services.Telemetry.msSinceProcessStart()` instead, which is guaranteed to be monotonic.

TelemetrySend.jsm:
There is monotonic time inside this module, replace occurrences of `new Date` usages (as well as `Policy.now`) with monotonic one.

monotonicNow: https://dxr.mozilla.org/mozilla-central/rev/b1b9129838ade91684574f42219b2010928d7db4/toolkit/components/telemetry/TelemetrySend.jsm#105

usages of `new Date`:
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/TelemetrySend.jsm#421

https://dxr.mozilla.org/mozilla-central/rev/b1b9129838ade91684574f42219b2010928d7db4/toolkit/components/telemetry/TelemetrySend.jsm#421,1173,1176,1192,1196-1197

usages of `Policy.now`:
https://dxr.mozilla.org/mozilla-central/rev/b1b9129838ade91684574f42219b2010928d7db4/toolkit/components/telemetry/TelemetrySend.jsm#507,521,725,1091

test_TelemetrySend.js:
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js#103,207

The same problem in lots of telemetry files.
Depends on: 1376629
Priority: -- → P4
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.