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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 22815003: Add detailed performance histograms to Files.app. (Abandoned) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed histograms. Created 7 years, 4 months 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: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 9ef23dc9226acc8b110397e2fde9fa502c339d72..cd59e7e7382da33964d171a24f16e8b3dd8cfa5f 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -210,6 +210,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
};
FileManager.prototype.initPreferences_ = function(callback) {
+ metrics.startInterval('Load.Preferences');
var group = new AsyncUtil.Group();
// DRIVE preferences should be initialized before creating DirectoryModel
@@ -250,7 +251,10 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
// TODO(yoshiki): Remove this in M31 http://crbug.com/268784/
chrome.storage.local.remove('folder-shortcuts-list');
- group.run(callback);
+ group.run(function() {
+ metrics.recordInterval('Load.Preferences');
+ callback();
+ });
};
/**
@@ -284,6 +288,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initFileSystemUI_ = function(callback) {
+ metrics.startInterval('Load.FileSystemUI');
this.table_.startBatchUpdates();
this.grid_.startBatchUpdates();
@@ -408,6 +413,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.table_.endBatchUpdates();
this.grid_.endBatchUpdates();
+ metrics.recordInterval('Load.FileSystemUI');
callback();
};
@@ -716,6 +722,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initGeneral_ = function(callback) {
+ metrics.startInterval('Load.General');
this.volumeManager_ = VolumeManager.getInstance();
if (window.appState) {
this.params_ = window.appState.params || {};
@@ -726,6 +733,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
{};
this.defaultPath = this.params_.defaultPath;
}
+ metrics.recordInterval('Load.General');
callback();
};
@@ -736,16 +744,19 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initStrings_ = function(callback) {
+ metrics.startInterval('Load.Strings');
// Fetch the strings via the private api if running in the browser window.
// Otherwise, read cached strings from the local storage.
if (util.platform.runningInBrowser()) {
chrome.fileBrowserPrivate.getStrings(function(strings) {
loadTimeData.data = strings;
+ metrics.recordInterval('Load.Strings');
callback();
});
} else {
chrome.storage.local.get('strings', function(items) {
loadTimeData.data = items['strings'];
+ metrics.recordInterval('Load.Strings');
callback();
});
}
@@ -761,6 +772,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initEssentialUI_ = function(callback) {
+ metrics.startInterval('Load.EssentialUI');
this.listType_ = null;
this.filesystemObserverId_ = null;
@@ -810,13 +822,16 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.initDialogType_();
+ metrics.recordInterval('Load.Display');
+ metrics.recordInterval('Load.EssentialUI');
+
// Show the window as soon as the UI pre-initialization is done.
if (this.dialogType == DialogType.FULL_PAGE &&
!util.platform.runningInBrowser()) {
chrome.app.window.current().show();
setTimeout(callback, 100); // Wait until the animation is finished.
} else {
- callback();
+ callback();
}
};
@@ -846,6 +861,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initAdditionalUI_ = function(callback) {
+ metrics.startInterval('Load.AdditionalUI');
this.initDialogs_();
this.dialogDom_.addEventListener('drop', function(e) {
@@ -1042,6 +1058,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.table_.normalizeColumns();
this.table_.redraw();
+ metrics.recordInterval('Load.AdditionalUI');
callback();
};

Powered by Google App Engine
This is Rietveld 408576698