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

Side by Side Diff: net/socket/client_socket_pool_histograms.cc

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/socket/ssl_client_socket_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/client_socket_pool_histograms.h" 5 #include "net/socket/client_socket_pool_histograms.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "net/socket/client_socket_handle.h" 11 #include "net/socket/client_socket_handle.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ClientSocketPoolHistograms::~ClientSocketPoolHistograms() { 51 ClientSocketPoolHistograms::~ClientSocketPoolHistograms() {
52 } 52 }
53 53
54 void ClientSocketPoolHistograms::AddSocketType(int type) const { 54 void ClientSocketPoolHistograms::AddSocketType(int type) const {
55 socket_type_->Add(type); 55 socket_type_->Add(type);
56 } 56 }
57 57
58 void ClientSocketPoolHistograms::AddRequestTime(base::TimeDelta time) const { 58 void ClientSocketPoolHistograms::AddRequestTime(base::TimeDelta time) const {
59 request_time_->AddTime(time); 59 request_time_->AddTime(time);
60 60
61 static bool proxy_connection_impact_trial_exists( 61 static const bool proxy_connection_impact_trial_exists =
62 base::FieldTrialList::Find("ProxyConnectionImpact") && 62 base::FieldTrialList::TrialExists("ProxyConnectionImpact");
63 !base::FieldTrialList::Find("ProxyConnectionImpact")->
64 group_name().empty());
65 if (proxy_connection_impact_trial_exists && is_http_proxy_connection_) { 63 if (proxy_connection_impact_trial_exists && is_http_proxy_connection_) {
66 UMA_HISTOGRAM_CUSTOM_TIMES( 64 UMA_HISTOGRAM_CUSTOM_TIMES(
67 base::FieldTrial::MakeName("Net.HttpProxySocketRequestTime", 65 base::FieldTrial::MakeName("Net.HttpProxySocketRequestTime",
68 "ProxyConnectionImpact"), 66 "ProxyConnectionImpact"),
69 time, 67 time,
70 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 68 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
71 100); 69 100);
72 } 70 }
73 if (proxy_connection_impact_trial_exists && is_socks_connection_) { 71 if (proxy_connection_impact_trial_exists && is_socks_connection_) {
74 UMA_HISTOGRAM_CUSTOM_TIMES( 72 UMA_HISTOGRAM_CUSTOM_TIMES(
75 base::FieldTrial::MakeName("Net.SocksSocketRequestTime", 73 base::FieldTrial::MakeName("Net.SocksSocketRequestTime",
76 "ProxyConnectionImpact"), 74 "ProxyConnectionImpact"),
77 time, 75 time,
78 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 76 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
79 100); 77 100);
80 } 78 }
81 } 79 }
82 80
83 void ClientSocketPoolHistograms::AddUnusedIdleTime(base::TimeDelta time) const { 81 void ClientSocketPoolHistograms::AddUnusedIdleTime(base::TimeDelta time) const {
84 unused_idle_time_->AddTime(time); 82 unused_idle_time_->AddTime(time);
85 } 83 }
86 84
87 void ClientSocketPoolHistograms::AddReusedIdleTime(base::TimeDelta time) const { 85 void ClientSocketPoolHistograms::AddReusedIdleTime(base::TimeDelta time) const {
88 reused_idle_time_->AddTime(time); 86 reused_idle_time_->AddTime(time);
89 } 87 }
90 88
91 } // namespace net 89 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/socket/ssl_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698