Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: ui/file_manager/file_manager/background/js/background.js

Issue 2585193002: Files App: Add metrics for background performance. (Closed)
Patch Set: Update histograms.xml. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/background/js/background.js
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js
index ee0414d9a891ce82b2c6610872cc5e0d6b07da4a..251150d171b4cd8a89dd83a76e96d015da541505 100644
--- a/ui/file_manager/file_manager/background/js/background.js
+++ b/ui/file_manager/file_manager/background/js/background.js
@@ -462,6 +462,7 @@ FileBrowserBackground.prototype.onExecute_ = function(action, details) {
* @override
*/
FileBrowserBackground.prototype.onLaunched_ = function() {
+ metrics.startInterval('Load.BackgroundLaunch');
this.initializationPromise_.then(function() {
if (nextFileManagerWindowID == 0) {
// The app just launched. Remove window state records that are not needed
@@ -475,7 +476,9 @@ FileBrowserBackground.prototype.onLaunched_ = function() {
}
});
}
- launchFileManager(null, undefined, LaunchType.FOCUS_ANY_OR_CREATE);
+ launchFileManager(
+ null, undefined, LaunchType.FOCUS_ANY_OR_CREATE,
+ function() { metrics.recordInterval('Load.BackgroundLaunch'); });
});
};
@@ -507,10 +510,13 @@ FileBrowserBackground.prototype.onRestarted_ = function() {
if (items.hasOwnProperty(key)) {
var match = key.match(FILES_ID_PATTERN);
if (match) {
+ metrics.startInterval('Load.BackgroundRestart');
var id = Number(match[1]);
try {
var appState = /** @type {Object} */ (JSON.parse(items[key]));
- launchFileManager(appState, id);
+ launchFileManager(appState, id, undefined, function() {
+ metrics.recordInterval('Load.BackgroundRestart');
+ });
} catch (e) {
console.error('Corrupt launch data for ' + id);
}
@@ -626,3 +632,4 @@ FileBrowserBackground.prototype.initContextMenu_ = function() {
* @type {FileBrowserBackground}
*/
window.background = new FileBrowserBackground();
+metrics.recordInterval('Load.BackgroundScript');
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/file_manager/file_manager/background/js/background_scripts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698