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

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: 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..be823bd4acb63b4a5e604179d15dd76313f67574 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::HighResNow();
+
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::HighResNow() - before_time).InMicroseconds(),
jar (doing other things) 2013/02/01 00:50:37 Since you're converting to microseconds, don't bot
SteveT 2013/02/01 14:17:45 That sounds good. Thanks for pointing it out. Don
+ 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