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

Unified Diff: chrome/browser/metrics/variations/variations_http_header_provider.cc

Issue 12090055: Measure the X-Chrome-Variations construction time with UMA. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: jar tip Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations/variations_http_header_provider.cc
diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.cc b/chrome/browser/metrics/variations/variations_http_header_provider.cc
index 1e7d7877cf3242a34d1e5fbf2e958076538b2728..bcc7a4a4d1cf2d7a3d58efc68b0d8541f9720e9f 100644
--- a/chrome/browser/metrics/variations/variations_http_header_provider.cc
+++ b/chrome/browser/metrics/variations/variations_http_header_provider.cc
@@ -6,6 +6,7 @@
#include "base/base64.h"
#include "base/memory/singleton.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_io_data.h"
@@ -92,6 +93,8 @@ void VariationsHttpHeaderProvider::InitVariationIDsCacheIfNeeded() {
DCHECK(MessageLoop::current());
base::FieldTrialList::AddObserver(this);
+ base::TimeTicks before_time = base::TimeTicks::Now();
+
base::FieldTrial::ActiveGroups initial_groups;
base::FieldTrialList::GetActiveFieldTrialGroups(&initial_groups);
for (base::FieldTrial::ActiveGroups::const_iterator it =
@@ -105,6 +108,13 @@ void VariationsHttpHeaderProvider::InitVariationIDsCacheIfNeeded() {
}
UpdateVariationIDsHeaderValue();
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Variations.HeaderConstructionTime",
+ (base::TimeTicks::Now() - before_time).InMicroseconds(),
+ 0,
+ base::TimeDelta::FromSeconds(1).InMicroseconds(),
+ 50);
+
variation_ids_cache_initialized_ = true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698