зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338812 - Call TelemetryStopwatch only once per item (history / bookmarks / logins) rather than for each resource. r=Gijs
MozReview-Commit-ID: 7c5DgKDIFTv --HG-- extra : rebase_source : 9141f895c95f31b682e047d7df203aed32e3d65b
This commit is contained in:
Родитель
c87ff7ce1d
Коммит
e247cf9a5f
|
@ -249,16 +249,16 @@ this.MigratorPrototype = {
|
|||
}
|
||||
return null;
|
||||
};
|
||||
let maybeStartTelemetryStopwatch = (resourceType, resource) => {
|
||||
let maybeStartTelemetryStopwatch = (resourceType) => {
|
||||
let histogram = getHistogramForResourceType(resourceType);
|
||||
if (histogram) {
|
||||
TelemetryStopwatch.startKeyed(histogram, this.getKey(), resource);
|
||||
TelemetryStopwatch.startKeyed(histogram, this.getKey());
|
||||
}
|
||||
};
|
||||
let maybeStopTelemetryStopwatch = (resourceType, resource) => {
|
||||
let maybeStopTelemetryStopwatch = (resourceType) => {
|
||||
let histogram = getHistogramForResourceType(resourceType);
|
||||
if (histogram) {
|
||||
TelemetryStopwatch.finishKeyed(histogram, this.getKey(), resource);
|
||||
TelemetryStopwatch.finishKeyed(histogram, this.getKey());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -297,12 +297,12 @@ this.MigratorPrototype = {
|
|||
for (let [migrationType, itemResources] of resourcesGroupedByItems) {
|
||||
notify("Migration:ItemBeforeMigrate", migrationType);
|
||||
|
||||
maybeStartTelemetryStopwatch(migrationType);
|
||||
|
||||
let itemSuccess = false;
|
||||
for (let res of itemResources) {
|
||||
maybeStartTelemetryStopwatch(migrationType, res);
|
||||
let completeDeferred = PromiseUtils.defer();
|
||||
let resourceDone = function(aSuccess) {
|
||||
maybeStopTelemetryStopwatch(migrationType, res);
|
||||
itemResources.delete(res);
|
||||
itemSuccess |= aSuccess;
|
||||
if (itemResources.size == 0) {
|
||||
|
@ -310,6 +310,9 @@ this.MigratorPrototype = {
|
|||
"Migration:ItemAfterMigrate" : "Migration:ItemError",
|
||||
migrationType);
|
||||
resourcesGroupedByItems.delete(migrationType);
|
||||
|
||||
maybeStopTelemetryStopwatch(migrationType);
|
||||
|
||||
if (resourcesGroupedByItems.size == 0) {
|
||||
collectQuantityTelemetry();
|
||||
notify("Migration:Ended");
|
||||
|
|
Загрузка…
Ссылка в новой задаче