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

Unified Diff: ios/chrome/browser/ui/stack_view/stack_view_controller.mm

Issue 2895013002: Perf metric tracking the wallclock time it takes to show a new tab page. (Closed)
Patch Set: Review nits Created 3 years, 6 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
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/stack_view/stack_view_controller.mm
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm
index cdb4ba2b667ddd566f64f01b38844dd897bdc29d..6b2a75f682456648d92c1ede80c3de9c4fe286bc 100644
--- a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm
+++ b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm
@@ -2025,6 +2025,10 @@ NSString* const kDummyToolbarBackgroundViewAnimationKey =
- (Tab*)dismissWithNewTabAnimation:(const GURL&)URL
atIndex:(NSUInteger)position
transition:(ui::PageTransition)transition {
+ // Record the start time for this operation so it may be reported as a metric
+ // in the animation completion block.
+ NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate];
+
// This helps smooth out the animation.
[[_scrollView layer] setShouldRasterize:YES];
if (_isBeingDismissed)
@@ -2077,6 +2081,15 @@ NSString* const kDummyToolbarBackgroundViewAnimationKey =
[newCard removeFromSuperview];
[[_scrollView layer] setShouldRasterize:NO];
[_delegate tabSwitcherDismissTransitionDidEnd:self];
+ double duration = [NSDate timeIntervalSinceReferenceDate] - startTime;
+ if (_activeCardSet.tabModel.isOffTheRecord) {
+ UMA_HISTOGRAM_TIMES(
+ "Toolbar.TabSwitcher.NewIncognitoTabPresentationDurationn",
+ base::TimeDelta::FromSecondsD(duration));
+ } else {
+ UMA_HISTOGRAM_TIMES("Toolbar.TabSwitcher.NewTabPresentationDuration",
+ base::TimeDelta::FromSecondsD(duration));
+ }
};
CGPoint origin = _lastTapPoint;
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698