Bug 1815524 - Round up FirstStartup timing probes to the nearest uint. r=rhelmer

This is because sometimes these timings will be less than 1 millisecond, and we
were coercing those fractional numbers to a uint which caused it to become 0.

This patch causes us to round up to the nearest uint instead.

It also adds the AppConstants.MOZ_NORMANDY condition for recording the timing
value for Normandy init, which I'd somehow missed the first time.

Differential Revision: https://phabricator.services.mozilla.com/D182785
This commit is contained in:
Mike Conley
2023-07-05 16:10:16 +00:00
parent 27035048bb
commit 1012c8ef8f

View File

@@ -86,13 +86,15 @@ export var FirstStartup = {
this._state = this.UNSUPPORTED;
}
Glean.firstStartup.normandyInitTime.set(
normandyInitEndTime || Cu.now() - startingTime
);
if (AppConstants.MOZ_NORMANDY) {
Glean.firstStartup.normandyInitTime.set(
Math.ceil(normandyInitEndTime || Cu.now() - startingTime)
);
}
if (AppConstants.MOZ_UPDATE_AGENT) {
Glean.firstStartup.deleteTasksTime.set(
deleteTasksEndTime || Cu.now() - startingTime
Math.ceil(deleteTasksEndTime || Cu.now() - startingTime)
);
}