зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1063561 - Convert Addon Manager telemetry timings to use Components.utils.now(); r=irvingreid
This commit is contained in:
Родитель
094e8228cc
Коммит
66dc378c73
|
@ -2431,9 +2431,9 @@ this.AddonManagerPrivate = {
|
|||
// Start a timer, record a simple measure of the time interval when
|
||||
// timer.done() is called
|
||||
simpleTimer: function(aName) {
|
||||
let startTime = Date.now();
|
||||
let startTime = Cu.now();
|
||||
return {
|
||||
done: () => this.recordSimpleMeasure(aName, Date.now() - startTime)
|
||||
done: () => this.recordSimpleMeasure(aName, Math.round(Cu.now() - startTime))
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -1494,7 +1494,7 @@ XPIState.prototype = {
|
|||
*/
|
||||
getModTime(aFile, aId) {
|
||||
let changed = false;
|
||||
let scanStarted = Date.now();
|
||||
let scanStarted = Cu.now();
|
||||
// For an unknown or enabled add-on, we do a full recursive scan.
|
||||
if (!('scanTime' in this) || this.enabled) {
|
||||
logger.debug('getModTime: Recursive scan of ' + aId);
|
||||
|
@ -1539,7 +1539,7 @@ XPIState.prototype = {
|
|||
}
|
||||
}
|
||||
// Record duration of file-modified check
|
||||
XPIProvider.setTelemetry(aId, "scan_MS", Date.now() - scanStarted);
|
||||
XPIProvider.setTelemetry(aId, "scan_MS", Math.round(Cu.now() - scanStarted));
|
||||
|
||||
return changed;
|
||||
},
|
||||
|
@ -3539,10 +3539,10 @@ this.XPIProvider = {
|
|||
}
|
||||
|
||||
// Telemetry probe added around getInstallState() to check perf
|
||||
let telemetryCaptureTime = Date.now();
|
||||
let telemetryCaptureTime = Cu.now();
|
||||
let installChanged = XPIStates.getInstallState();
|
||||
let telemetry = Services.telemetry;
|
||||
telemetry.getHistogramById("CHECK_ADDONS_MODIFIED_MS").add(Date.now() - telemetryCaptureTime);
|
||||
telemetry.getHistogramById("CHECK_ADDONS_MODIFIED_MS").add(Math.round(Cu.now() - telemetryCaptureTime));
|
||||
if (installChanged) {
|
||||
updateReasons.push("directoryState");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче