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

Side by Side Diff: net/http/http_network_transaction.cc

Issue 515033: Cleanup histogram classes mixing SetFlags into FactoryGet arguments... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_server_type_histograms.cc ('k') | net/socket_stream/socket_stream_metrics.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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/field_trial.h" 10 #include "base/field_trial.h"
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 !FieldTrial::MakeName("", "SocketLateBinding").empty(); 1150 !FieldTrial::MakeName("", "SocketLateBinding").empty();
1151 1151
1152 if (handle.reuse_type() == ClientSocketHandle::UNUSED) { 1152 if (handle.reuse_type() == ClientSocketHandle::UNUSED) {
1153 UMA_HISTOGRAM_CLIPPED_TIMES( 1153 UMA_HISTOGRAM_CLIPPED_TIMES(
1154 "Net.Dns_Resolution_And_TCP_Connection_Latency", 1154 "Net.Dns_Resolution_And_TCP_Connection_Latency",
1155 time_to_obtain_connected_socket, 1155 time_to_obtain_connected_socket,
1156 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 1156 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
1157 100); 1157 100);
1158 } 1158 }
1159 1159
1160 static scoped_refptr<Histogram> tcp_socket_type_counter = 1160 UMA_HISTOGRAM_ENUMERATION("Net.TCPSocketType", handle.reuse_type(),
1161 LinearHistogram::LinearHistogramFactoryGet( 1161 ClientSocketHandle::NUM_TYPES);
1162 "Net.TCPSocketType",
1163 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
1164 tcp_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
1165 tcp_socket_type_counter->Add(handle.reuse_type());
1166 1162
1167 if (use_late_binding_histogram) { 1163 if (use_late_binding_histogram) {
1168 static scoped_refptr<Histogram> tcp_socket_type_counter2 = 1164 UMA_HISTOGRAM_ENUMERATION(
1169 LinearHistogram::LinearHistogramFactoryGet( 1165 FieldTrial::MakeName("Net.TCPSocketType", "SocketLateBinding"),
1170 FieldTrial::MakeName("Net.TCPSocketType", 1166 handle.reuse_type(), ClientSocketHandle::NUM_TYPES);
1171 "SocketLateBinding").data(),
1172 1, ClientSocketHandle::NUM_TYPES,
1173 ClientSocketHandle::NUM_TYPES + 1);
1174 tcp_socket_type_counter2->SetFlags(kUmaTargetedHistogramFlag);
1175 tcp_socket_type_counter2->Add(handle.reuse_type());
1176 } 1167 }
1177 1168
1178 UMA_HISTOGRAM_CLIPPED_TIMES( 1169 UMA_HISTOGRAM_CLIPPED_TIMES(
1179 "Net.TransportSocketRequestTime", 1170 "Net.TransportSocketRequestTime",
1180 time_to_obtain_connected_socket, 1171 time_to_obtain_connected_socket,
1181 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), 1172 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
1182 100); 1173 100);
1183 1174
1184 if (use_late_binding_histogram) { 1175 if (use_late_binding_histogram) {
1185 UMA_HISTOGRAM_CUSTOM_TIMES( 1176 UMA_HISTOGRAM_CUSTOM_TIMES(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 NOTREACHED(); 1214 NOTREACHED();
1224 break; 1215 break;
1225 } 1216 }
1226 } 1217 }
1227 1218
1228 void HttpNetworkTransaction::LogIOErrorMetrics( 1219 void HttpNetworkTransaction::LogIOErrorMetrics(
1229 const ClientSocketHandle& handle) { 1220 const ClientSocketHandle& handle) {
1230 static const bool use_late_binding_histogram = 1221 static const bool use_late_binding_histogram =
1231 !FieldTrial::MakeName("", "SocketLateBinding").empty(); 1222 !FieldTrial::MakeName("", "SocketLateBinding").empty();
1232 1223
1233 static scoped_refptr<Histogram> io_error_socket_type_counter = 1224 UMA_HISTOGRAM_ENUMERATION("Net.IOError_SocketReuseType",
1234 LinearHistogram::LinearHistogramFactoryGet( 1225 handle.reuse_type(), ClientSocketHandle::NUM_TYPES);
1235 "Net.IOError_SocketReuseType",
1236 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1);
1237 io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
1238 io_error_socket_type_counter->Add(handle.reuse_type());
1239 1226
1240 if (use_late_binding_histogram) { 1227 if (use_late_binding_histogram) {
1241 static scoped_refptr<Histogram> io_error_socket_type_counter = 1228 UMA_HISTOGRAM_ENUMERATION(
1242 LinearHistogram::LinearHistogramFactoryGet( 1229 FieldTrial::MakeName("Net.IOError_SocketReuseType",
1243 FieldTrial::MakeName("Net.IOError_SocketReuseType", 1230 "SocketLateBinding"),
1244 "SocketLateBinding").data(), 1231 handle.reuse_type(), ClientSocketHandle::NUM_TYPES);
1245 1, ClientSocketHandle::NUM_TYPES,
1246 ClientSocketHandle::NUM_TYPES + 1);
1247 io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag);
1248 io_error_socket_type_counter->Add(handle.reuse_type());
1249 } 1232 }
1250 1233
1251 switch (handle.reuse_type()) { 1234 switch (handle.reuse_type()) {
1252 case ClientSocketHandle::UNUSED: 1235 case ClientSocketHandle::UNUSED:
1253 break; 1236 break;
1254 case ClientSocketHandle::UNUSED_IDLE: 1237 case ClientSocketHandle::UNUSED_IDLE:
1255 UMA_HISTOGRAM_CUSTOM_TIMES( 1238 UMA_HISTOGRAM_CUSTOM_TIMES(
1256 "Net.SocketIdleTimeOnIOError2_UnusedSocket", 1239 "Net.SocketIdleTimeOnIOError2_UnusedSocket",
1257 handle.idle_time(), base::TimeDelta::FromMilliseconds(1), 1240 handle.idle_time(), base::TimeDelta::FromMilliseconds(1),
1258 base::TimeDelta::FromMinutes(6), 100); 1241 base::TimeDelta::FromMinutes(6), 100);
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 AuthChallengeInfo* auth_info = new AuthChallengeInfo; 1820 AuthChallengeInfo* auth_info = new AuthChallengeInfo;
1838 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; 1821 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY;
1839 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); 1822 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin));
1840 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); 1823 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme());
1841 // TODO(eroman): decode realm according to RFC 2047. 1824 // TODO(eroman): decode realm according to RFC 2047.
1842 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); 1825 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm());
1843 response_.auth_challenge = auth_info; 1826 response_.auth_challenge = auth_info;
1844 } 1827 }
1845 1828
1846 } // namespace net 1829 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_server_type_histograms.cc ('k') | net/socket_stream/socket_stream_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698