diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-28 06:59:52 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-28 06:59:52 +0000 |
commit | 2753b39e0c2e83d3b497ebadc2d720f12b74db40 (patch) | |
tree | 01edf034e65922a229b3ccbaef8291059ac5e2bc /net/http | |
parent | e660e88dc26b9b31c48c815b2358212ea4067ca5 (diff) | |
download | chromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.zip chromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.tar.gz chromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.tar.bz2 |
Cleanup histogram classes mixing SetFlags into FactoryGet arguments
Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet,
along with reformatting.
The macros were cleaned up to use common sub-macros rather than
repeating code as much.
Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros)
since this class was not getting used.
I introduced UMA_HISTOGRAM_ENUMERATION to support the common use
of LinearHistograms to count various enumerated values.
I added a Flags argument to all the FactoryGet routines to help avoid
needing to call SetFlags each time a new sample is Add()ed. This also
simplifies the code.
This will all help prepare for a "don't histogram at all" macro setting
so that I can test the impact of the histogram macro calls on
performance (since there are now so many active histograms).
BUG=31206
r=raman.tenneti
Review URL: http://codereview.chromium.org/515033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.cc | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index eb50716..d61188a 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -1157,22 +1157,13 @@ void HttpNetworkTransaction::LogTCPConnectedMetrics( 100); } - static scoped_refptr<Histogram> tcp_socket_type_counter = - LinearHistogram::LinearHistogramFactoryGet( - "Net.TCPSocketType", - 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1); - tcp_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag); - tcp_socket_type_counter->Add(handle.reuse_type()); + UMA_HISTOGRAM_ENUMERATION("Net.TCPSocketType", handle.reuse_type(), + ClientSocketHandle::NUM_TYPES); if (use_late_binding_histogram) { - static scoped_refptr<Histogram> tcp_socket_type_counter2 = - LinearHistogram::LinearHistogramFactoryGet( - FieldTrial::MakeName("Net.TCPSocketType", - "SocketLateBinding").data(), - 1, ClientSocketHandle::NUM_TYPES, - ClientSocketHandle::NUM_TYPES + 1); - tcp_socket_type_counter2->SetFlags(kUmaTargetedHistogramFlag); - tcp_socket_type_counter2->Add(handle.reuse_type()); + UMA_HISTOGRAM_ENUMERATION( + FieldTrial::MakeName("Net.TCPSocketType", "SocketLateBinding"), + handle.reuse_type(), ClientSocketHandle::NUM_TYPES); } UMA_HISTOGRAM_CLIPPED_TIMES( @@ -1230,22 +1221,14 @@ void HttpNetworkTransaction::LogIOErrorMetrics( static const bool use_late_binding_histogram = !FieldTrial::MakeName("", "SocketLateBinding").empty(); - static scoped_refptr<Histogram> io_error_socket_type_counter = - LinearHistogram::LinearHistogramFactoryGet( - "Net.IOError_SocketReuseType", - 1, ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1); - io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag); - io_error_socket_type_counter->Add(handle.reuse_type()); + UMA_HISTOGRAM_ENUMERATION("Net.IOError_SocketReuseType", + handle.reuse_type(), ClientSocketHandle::NUM_TYPES); if (use_late_binding_histogram) { - static scoped_refptr<Histogram> io_error_socket_type_counter = - LinearHistogram::LinearHistogramFactoryGet( - FieldTrial::MakeName("Net.IOError_SocketReuseType", - "SocketLateBinding").data(), - 1, ClientSocketHandle::NUM_TYPES, - ClientSocketHandle::NUM_TYPES + 1); - io_error_socket_type_counter->SetFlags(kUmaTargetedHistogramFlag); - io_error_socket_type_counter->Add(handle.reuse_type()); + UMA_HISTOGRAM_ENUMERATION( + FieldTrial::MakeName("Net.IOError_SocketReuseType", + "SocketLateBinding"), + handle.reuse_type(), ClientSocketHandle::NUM_TYPES); } switch (handle.reuse_type()) { |