Bug 1120650: add telemetry probe for slow script notices. r=vladan, r=billm

This commit is contained in:
Avi Halachmi 2015-02-06 16:02:37 +02:00
parent 7f11ffb388
commit 5b43bf50df
3 changed files with 27 additions and 0 deletions

View File

@ -278,6 +278,17 @@ let ProcessHangMonitor = {
return;
}
// On e10s this counts slow-script/hanged-plugin notice only once.
// This code is not reached on non-e10s.
if (report.hangType == report.SLOW_SCRIPT) {
// On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp
Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add();
} else if (report.hangType == report.PLUGIN_HANG) {
// On non-e10s we have sufficient plugin telemetry probes,
// so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s.
Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add();
}
// Otherwise create a new timer and display the report.
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(this, HANG_EXPIRATION_TIME, timer.TYPE_ONE_SHOT);

View File

@ -11024,6 +11024,10 @@ nsGlobalWindow::ShowSlowScriptDialog()
return ContinueSlowScriptAndKeepNotifying;
}
// Reached only on non-e10s - once per slow script dialog.
// On e10s - we probe once at ProcessHangsMonitor.jsm
Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTICE_COUNT, 1);
// Get the nsIPrompt interface from the docshell
nsCOMPtr<nsIDocShell> ds = GetDocShell();
NS_ENSURE_TRUE(ds, KillSlowScript);

View File

@ -7373,5 +7373,17 @@
"expires_in_version": "45",
"kind": "count",
"description": "The number of Sync 1.5 migrations completed by Android Sync."
},
"SLOW_SCRIPT_NOTICE_COUNT": {
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
"expires_in_version": "never",
"kind": "count",
"description": "Count slow script notices"
},
"PLUGIN_HANG_NOTICE_COUNT": {
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
"expires_in_version": "never",
"kind": "count",
"description": "Count plugin hang notices in e10s"
}
}