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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 818513002: Android: UMA histogram for coldstart-to-commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/metrics/histogram.h"
11 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" 12 #include "chrome/browser/android/chrome_web_contents_delegate_android.h"
13 #include "chrome/browser/android/uma_utils.h"
12 #include "chrome/browser/browser_about_handler.h" 14 #include "chrome/browser/browser_about_handler.h"
13 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 16 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
15 #include "chrome/browser/favicon/favicon_tab_helper.h" 17 #include "chrome/browser/favicon/favicon_tab_helper.h"
16 #include "chrome/browser/infobars/infobar_service.h" 18 #include "chrome/browser/infobars/infobar_service.h"
17 #include "chrome/browser/prerender/prerender_contents.h" 19 #include "chrome/browser/prerender/prerender_contents.h"
18 #include "chrome/browser/prerender/prerender_manager.h" 20 #include "chrome/browser/prerender/prerender_manager.h"
19 #include "chrome/browser/prerender/prerender_manager_factory.h" 21 #include "chrome/browser/prerender/prerender_manager_factory.h"
20 #include "chrome/browser/printing/print_view_manager_basic.h" 22 #include "chrome/browser/printing/print_view_manager_basic.h"
21 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 static void Init(JNIEnv* env, jobject obj) { 743 static void Init(JNIEnv* env, jobject obj) {
742 TRACE_EVENT0("native", "TabAndroid::Init"); 744 TRACE_EVENT0("native", "TabAndroid::Init");
743 // This will automatically bind to the Java object and pass ownership there. 745 // This will automatically bind to the Java object and pass ownership there.
744 new TabAndroid(env, obj); 746 new TabAndroid(env, obj);
745 } 747 }
746 748
747 // static 749 // static
748 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 750 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
749 return RegisterNativesImpl(env); 751 return RegisterNativesImpl(env);
750 } 752 }
753
754 static void RecordStartupToCommitUma(JNIEnv* env, jclass jcaller) {
755 // Currently it takes about 2000ms to commit a navigation if the measurement
756 // begins very early in the browser start. How many buckets (b) are needed to
757 // explore the _typical_ values with granularity 100ms and a maximum duration
758 // of 1 minute?
759 // s^{n+1} / s^{n} = 2100 / 2000
760 // s = 1.05
761 // s^b = 60000
762 // b = ln(60000) / ln(1.05) ~= 225
763 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
764 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
765 base::TimeDelta::FromMilliseconds(1),
766 base::TimeDelta::FromMinutes(1),
767 225);
768 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698