OLD | NEW |
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 Loading... |
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 |
OLD | NEW |