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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2894513002: Adding tools menu responsiveness metric. (Closed)
Patch Set: Created 3 years, 7 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: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 1271cea016bb063baa8cc2dd4162d3f0fff7faca..d24e44201cdf03d08721b9b8929c73938739b21b 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3384,6 +3384,22 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
DCHECK(_browserState);
DCHECK(self.visible || self.dismissingModal);
+ // Record the responsiveness of this show menu operation.
+ NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate];
rohitrao (ping after 24h) 2017/05/18 01:16:25 Another option would be to add this startTime to T
PL 2017/05/18 23:36:34 Done! This is a smart idea... the configuration is
+ __block id<NSObject> oneTimeObserver = [[NSNotificationCenter defaultCenter]
+ addObserverForName:kMenuDidShowNotification
+ object:nil
+ queue:nil
+ usingBlock:^(NSNotification* _Nonnull note) {
+ UMA_HISTOGRAM_TIMES(
+ "UI.Performance.ShowToolsMenuResponsiveness",
+ base::TimeDelta::FromSecondsD(
+ [NSDate timeIntervalSinceReferenceDate] - startTime));
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:oneTimeObserver];
+ oneTimeObserver = nil;
+ }];
+
// Dismiss the omnibox (if open).
[_toolbarController cancelOmniboxEdit];
// Dismiss the soft keyboard (if open).
« no previous file with comments | « no previous file | ios/chrome/browser/ui/toolbar/toolbar_controller.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698