Chromium Code Reviews| Index: components/signin/core/browser/signin_metrics.cc |
| diff --git a/components/signin/core/browser/signin_metrics.cc b/components/signin/core/browser/signin_metrics.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b26947f759b3666c31a66d0369aa95c7622e1ac |
| --- /dev/null |
| +++ b/components/signin/core/browser/signin_metrics.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/signin/core/browser/signin_metrics.h" |
| + |
| +#include "base/logging.h" |
| +#include "base/metrics/histogram.h" |
| +#include "base/metrics/user_metrics.h" |
| + |
| +namespace signin_metrics { |
| + |
| +void LogSigninAccountReconciliation(int total_number_accounts, |
| + int count_added_to_cookie_jar, |
| + int count_added_to_token, |
| + bool primary_accounts_same, |
| + bool is_first_reconcile) { |
| + UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfAccountsPerProfile", |
| + total_number_accounts); |
| + // We want to include zeroes in the counts of added accounts to easily |
| + // capture _relatively_ how often we merge accounts. |
| + if (is_first_reconcile) { |
| + UMA_HISTOGRAM_COUNTS_100("Signin.Reconciler.AddedToCookieJarFirstRun", |
|
Alexei Svitkine (slow)
2014/05/09 14:16:16
How about Signin.Reconciler.AddedToCookieJar.First
Mike Lerman
2014/05/09 20:13:27
Done.
|
| + count_added_to_cookie_jar); |
| + UMA_HISTOGRAM_COUNTS_100("Signin.Reconciler.AddedToChromeFirstRun", |
| + count_added_to_token); |
| + UMA_HISTOGRAM_BOOLEAN("Signin.Reconciler.DifferentPrimaryAccountsFirstRun", |
| + !primary_accounts_same); |
| + } else { |
| + UMA_HISTOGRAM_COUNTS_100("Signin.Reconciler.AddedToCookieJarSubsequentRun", |
| + count_added_to_cookie_jar); |
| + UMA_HISTOGRAM_COUNTS_100("Signin.Reconciler.AddedToChromeSubsequentRun", |
| + count_added_to_token); |
| + UMA_HISTOGRAM_BOOLEAN( |
| + "Signin.Reconciler.DifferentPrimaryAccountsSubsequentRun", |
| + !primary_accounts_same); |
| + } |
| +} |
| + |
| +} // namespace signin_metrics |