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

Side by Side Diff: net/socket_stream/socket_stream_metrics.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, 12 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/socket_stream/socket_stream_metrics.h" 5 #include "net/socket_stream/socket_stream_metrics.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 received_bytes_); 76 received_bytes_);
77 UMA_HISTOGRAM_COUNTS("Net.SocketStream.ReceivedCounts", 77 UMA_HISTOGRAM_COUNTS("Net.SocketStream.ReceivedCounts",
78 received_counts_); 78 received_counts_);
79 UMA_HISTOGRAM_COUNTS("Net.SocketStream.SentBytes", 79 UMA_HISTOGRAM_COUNTS("Net.SocketStream.SentBytes",
80 sent_bytes_); 80 sent_bytes_);
81 UMA_HISTOGRAM_COUNTS("Net.SocketStream.SentCounts", 81 UMA_HISTOGRAM_COUNTS("Net.SocketStream.SentCounts",
82 sent_counts_); 82 sent_counts_);
83 } 83 }
84 84
85 void SocketStreamMetrics::CountProtocolType(ProtocolType protocol_type) { 85 void SocketStreamMetrics::CountProtocolType(ProtocolType protocol_type) {
86 static scoped_refptr<Histogram> counter = 86 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.ProtocolType",
87 LinearHistogram::LinearHistogramFactoryGet( 87 protocol_type, NUM_PROTOCOL_TYPES);
88 "Net.SocketStream.ProtocolType",
89 0, NUM_PROTOCOL_TYPES, NUM_PROTOCOL_TYPES + 1);
90 counter->SetFlags(kUmaTargetedHistogramFlag);
91 counter->Add(protocol_type);
92 } 88 }
93 89
94 void SocketStreamMetrics::CountConnectionType(ConnectionType connection_type) { 90 void SocketStreamMetrics::CountConnectionType(ConnectionType connection_type) {
95 static scoped_refptr<Histogram> counter = 91 UMA_HISTOGRAM_ENUMERATION("Net.SocketStream.ConnectionType",
96 LinearHistogram::LinearHistogramFactoryGet( 92 connection_type, NUM_CONNECTION_TYPES);
97 "Net.SocketStream.ConnectionType",
98 1, NUM_CONNECTION_TYPES, NUM_CONNECTION_TYPES + 1);
99 counter->SetFlags(kUmaTargetedHistogramFlag);
100 counter->Add(connection_type);
101 } 93 }
102 94
103 95
104 } // namespace net 96 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/socket_stream/socket_stream_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698