mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
[Basilisk] Issue MoonchildProductions/GRE#3029 - Remove telemetry from FE
This commit is contained in:
parent
054e286777
commit
653cba3202
49 changed files with 17 additions and 1661 deletions
|
|
@ -45,8 +45,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "RunState",
|
|||
"resource:///modules/sessionstore/RunState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
||||
"resource://gre/modules/Task.jsm");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
|
||||
"@mozilla.org/base/telemetry;1", "nsITelemetry");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "sessionStartup",
|
||||
"@mozilla.org/browser/sessionstartup;1", "nsISessionStartup");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionWorker",
|
||||
|
|
@ -234,10 +232,6 @@ var SessionFileInternal = {
|
|||
source: source,
|
||||
parsed: parsed
|
||||
};
|
||||
Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE").
|
||||
add(false);
|
||||
Telemetry.getHistogramById("FX_SESSION_RESTORE_READ_FILE_MS").
|
||||
add(Date.now() - startMs);
|
||||
break;
|
||||
} catch (ex if ex instanceof OS.File.Error && ex.becauseNoSuchFile) {
|
||||
exists = false;
|
||||
|
|
@ -253,16 +247,12 @@ var SessionFileInternal = {
|
|||
} finally {
|
||||
if (exists) {
|
||||
noFilesFound = false;
|
||||
Telemetry.getHistogramById("FX_SESSION_RESTORE_CORRUPT_FILE").
|
||||
add(corrupted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All files are corrupted if files found but none could deliver a result.
|
||||
let allCorrupt = !noFilesFound && !result;
|
||||
Telemetry.getHistogramById("FX_SESSION_RESTORE_ALL_FILES_CORRUPT").
|
||||
add(allCorrupt);
|
||||
|
||||
if (!result) {
|
||||
// If everything fails, start with an empty session.
|
||||
|
|
@ -331,7 +321,6 @@ var SessionFileInternal = {
|
|||
// Wait until the write is done.
|
||||
promise = promise.then(msg => {
|
||||
// Record how long the write took.
|
||||
this._recordTelemetry(msg.telemetry);
|
||||
this._successes++;
|
||||
if (msg.result.upgradeBackup) {
|
||||
// We have just completed a backup-on-upgrade, store the information
|
||||
|
|
@ -379,19 +368,4 @@ var SessionFileInternal = {
|
|||
return this._postToWorker("wipe");
|
||||
},
|
||||
|
||||
_recordTelemetry: function(telemetry) {
|
||||
for (let id of Object.keys(telemetry)){
|
||||
let value = telemetry[id];
|
||||
let samples = [];
|
||||
if (Array.isArray(value)) {
|
||||
samples.push(...value);
|
||||
} else {
|
||||
samples.push(value);
|
||||
}
|
||||
let histogram = Telemetry.getHistogramById(id);
|
||||
for (let sample of samples) {
|
||||
histogram.add(sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue