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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 7354f24aac174ab3f381da39389d80b185b167c0..e7ce1c8d17890596a60fb6293005ec400bed861e 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -8,7 +8,9 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/debug/trace_event.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/android/chrome_web_contents_delegate_android.h"
+#include "chrome/browser/android/uma_utils.h"
#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
@@ -748,3 +750,19 @@ static void Init(JNIEnv* env, jobject obj) {
bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
+
+static void RecordStartupToCommitUma(JNIEnv* env, jclass jcaller) {
+ // Currently it takes about 2000ms to commit a navigation if the measurement
+ // begins very early in the browser start. How many buckets (b) are needed to
+ // explore the _typical_ values with granularity 100ms and a maximum duration
+ // of 1 minute?
+ // s^{n+1} / s^{n} = 2100 / 2000
+ // s = 1.05
+ // s^b = 60000
+ // b = ln(60000) / ln(1.05) ~= 225
+ UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
+ base::Time::Now() - chrome::android::GetMainEntryPointTime(),
+ base::TimeDelta::FromMilliseconds(1),
+ base::TimeDelta::FromMinutes(1),
+ 225);
+}

Powered by Google App Engine
This is Rietveld 408576698