diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 02:22:11 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 02:22:11 +0000 |
commit | 780702c2aac603a5ca09c22e34d3f913a375627d (patch) | |
tree | 9eec20da47f64859a072a8ca2ca03823953e5d52 /chrome/renderer/page_load_histograms.cc | |
parent | 8dc0234a8d2cec8bb1979ec8dec05bf23a79a42a (diff) | |
download | chromium_src-780702c2aac603a5ca09c22e34d3f913a375627d.zip chromium_src-780702c2aac603a5ca09c22e34d3f913a375627d.tar.gz chromium_src-780702c2aac603a5ca09c22e34d3f913a375627d.tar.bz2 |
Add one-time randomization support for FieldTrial, and the ability to
disable field trials. I am going to have a need for both soon.
Cleaning up some comments about empty trial names, adding static
method TrialExists() and simplifying many call sites by using this
method.
While I'm in there and needing base/OWNERS approval, add an OWNERS
file for base/metrics that adds jar@chromium.org as an owner for that
directory.
BUG=none
TEST=base_unittests
TBR=jam@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/page_load_histograms.cc')
-rw-r--r-- | chrome/renderer/page_load_histograms.cc | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc index 3ae1498..6bd2c85 100644 --- a/chrome/renderer/page_load_histograms.cc +++ b/chrome/renderer/page_load_histograms.cc @@ -270,8 +270,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if DNS prefetching has an impact on PLT. - static bool use_dns_histogram(base::FieldTrialList::Find("DnsImpact") && - !base::FieldTrialList::Find("DnsImpact")->group_name().empty()); + static const bool use_dns_histogram = + base::FieldTrialList::TrialExists("DnsImpact"); if (use_dns_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "DnsImpact"), @@ -307,8 +307,7 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // Histograms to determine if content prefetching has an impact on PLT. static const bool prefetching_fieldtrial = - base::FieldTrialList::Find("Prefetch") && - !base::FieldTrialList::Find("Prefetch")->group_name().empty(); + base::FieldTrialList::TrialExists("Prefetch"); if (prefetching_fieldtrial) { if (navigation_state->was_prefetcher()) { PLT_HISTOGRAM(base::FieldTrial::MakeName( @@ -338,9 +337,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if backup connection jobs have an impact on PLT. - static const bool connect_backup_jobs_fieldtrial( - base::FieldTrialList::Find("ConnnectBackupJobs") && - !base::FieldTrialList::Find("ConnnectBackupJobs")->group_name().empty()); + static const bool connect_backup_jobs_fieldtrial = + base::FieldTrialList::TrialExists("ConnnectBackupJobs"); if (connect_backup_jobs_fieldtrial) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ConnnectBackupJobs"), @@ -378,9 +376,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // impact on PLT. // TODO(jar): Consider removing the per-link-type versions. We // really only need LINK_LOAD_NORMAL and NORMAL_LOAD. - static bool use_connection_impact_histogram( - base::FieldTrialList::Find("ConnCountImpact") && - !base::FieldTrialList::Find("ConnCountImpact")->group_name().empty()); + static const bool use_connection_impact_histogram = + base::FieldTrialList::TrialExists("ConnCountImpact"); if (use_connection_impact_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ConnCountImpact"), @@ -412,9 +409,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine effect of idle socket timeout. - static bool use_idle_socket_timeout_histogram( - base::FieldTrialList::Find("IdleSktToImpact") && - !base::FieldTrialList::Find("IdleSktToImpact")->group_name().empty()); + static const bool use_idle_socket_timeout_histogram = + base::FieldTrialList::TrialExists("IdleSktToImpact"); if (use_idle_socket_timeout_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "IdleSktToImpact"), @@ -446,10 +442,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine effect of number of connections per proxy. - static bool use_proxy_connection_impact_histogram( - base::FieldTrialList::Find("ProxyConnectionImpact") && - !base::FieldTrialList::Find( - "ProxyConnectionImpact")->group_name().empty()); + static const bool use_proxy_connection_impact_histogram = + base::FieldTrialList::TrialExists("ProxyConnectionImpact"); if (use_proxy_connection_impact_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ProxyConnectionImpact"), @@ -482,8 +476,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // Histograms to determine if SDCH has an impact. // TODO(jar): Consider removing per-link load types and the enumeration. - static bool use_sdch_histogram(base::FieldTrialList::Find("GlobalSdch") && - !base::FieldTrialList::Find("GlobalSdch")->group_name().empty()); + static const bool use_sdch_histogram = + base::FieldTrialList::TrialExists("GlobalSdch"); if (use_sdch_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.LoadType", "GlobalSdch"), @@ -520,8 +514,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if cache size has an impact on PLT. - static bool use_cache_histogram1(base::FieldTrialList::Find("CacheSize") && - !base::FieldTrialList::Find("CacheSize")->group_name().empty()); + static const bool use_cache_histogram1 = + base::FieldTrialList::TrialExists("CacheSize"); if (use_cache_histogram1 && NavigationState::LINK_LOAD_NORMAL <= load_type && NavigationState::LINK_LOAD_CACHE_ONLY >= load_type) { // TODO(mbelshe): Do we really want BeginToFinishDoc here? It seems like @@ -531,9 +525,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if cache throttling has an impact on PLT. - static bool use_cache_histogram2( - base::FieldTrialList::Find("CacheThrottle") && - !base::FieldTrialList::Find("CacheThrottle")->group_name().empty()); + static const bool use_cache_histogram2 = + base::FieldTrialList::TrialExists("CacheThrottle"); if (use_cache_histogram2) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "CacheThrottle"), @@ -591,8 +584,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // if we asked for a HTTP request, we got a HTTP request // Due to spdy version mismatches, it is possible that we ask for SPDY // but didn't get SPDY. - static bool use_spdy_histogram(base::FieldTrialList::Find("SpdyImpact") && - !base::FieldTrialList::Find("SpdyImpact")->group_name().empty()); + static const bool use_spdy_histogram = + base::FieldTrialList::TrialExists("SpdyImpact"); if (use_spdy_histogram) { // We take extra effort to only compute these once. static bool in_spdy_trial = base::FieldTrialList::Find( @@ -749,8 +742,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } } - static bool false_start_trial(base::FieldTrialList::Find("SSLFalseStart") && - !base::FieldTrialList::Find("SSLFalseStart")->group_name().empty()); + static const bool false_start_trial = + base::FieldTrialList::TrialExists("SSLFalseStart"); if (false_start_trial) { if (scheme_type == URLPattern::SCHEME_HTTPS) { switch (load_type) { |