| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 5 #ifndef NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
| 6 #define NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 6 #define NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <bitset> | 10 #include <bitset> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 friend class test::QuicConnectionLoggerPeer; | 89 friend class test::QuicConnectionLoggerPeer; |
| 90 | 90 |
| 91 // Do a factory get for a histogram for recording data, about individual | 91 // Do a factory get for a histogram for recording data, about individual |
| 92 // packet numbers, that was gathered in the vectors | 92 // packet numbers, that was gathered in the vectors |
| 93 // received_packets_ and received_acks_. |statistic_name| identifies which | 93 // received_packets_ and received_acks_. |statistic_name| identifies which |
| 94 // element of data is recorded, and is used to form the histogram name. | 94 // element of data is recorded, and is used to form the histogram name. |
| 95 base::HistogramBase* GetPacketNumberHistogram( | 95 base::HistogramBase* GetPacketNumberHistogram( |
| 96 const char* statistic_name) const; | 96 const char* statistic_name) const; |
| 97 // Do a factory get for a histogram to record a 6-packet loss-sequence as a | |
| 98 // sample. The histogram will record the 64 distinct possible combinations. | |
| 99 // |which_6| is used to adjust the name of the histogram to distinguish the | |
| 100 // first 6 packets in a connection, vs. some later 6 packets. | |
| 101 base::HistogramBase* Get6PacketHistogram(const char* which_6) const; | |
| 102 // Do a factory get for a histogram to record cumulative stats across a 21 | |
| 103 // packet sequence. |which_21| is used to adjust the name of the histogram | |
| 104 // to distinguish the first 21 packets' loss data, vs. some later 21 packet | |
| 105 // sequences' loss data. | |
| 106 base::HistogramBase* Get21CumulativeHistogram(const char* which_21) const; | |
| 107 // Add samples associated with a |bit_mask_of_packets| to the given histogram | |
| 108 // that was provided by Get21CumulativeHistogram(). The LSB of that mask | |
| 109 // corresponds to the oldest packet number in the series of packets, | |
| 110 // and the bit in the 2^20 position corresponds to the most recently received | |
| 111 // packet. Of the maximum of 21 bits that are valid (correspond to packets), | |
| 112 // only the most significant |valid_bits_in_mask| are processed. | |
| 113 // A bit value of 0 indicates that a packet was never received, and a 1 | |
| 114 // indicates the packet was received. | |
| 115 static void AddTo21CumulativeHistogram(base::HistogramBase* histogram, | |
| 116 int bit_mask_of_packets, | |
| 117 int valid_bits_in_mask); | |
| 118 // For connections longer than 21 received packets, this call will calculate | 97 // For connections longer than 21 received packets, this call will calculate |
| 119 // the overall packet loss rate, and record it into a histogram. | 98 // the overall packet loss rate, and record it into a histogram. |
| 120 void RecordAggregatePacketLossRate() const; | 99 void RecordAggregatePacketLossRate() const; |
| 121 // At destruction time, this records results of |pacaket_received_| into | 100 // At destruction time, this records results of |pacaket_received_| into |
| 122 // histograms for specific connection types. | 101 // histograms for specific connection types. |
| 123 void RecordLossHistograms() const; | 102 void RecordLossHistograms() const; |
| 124 | 103 |
| 125 BoundNetLog net_log_; | 104 BoundNetLog net_log_; |
| 126 QuicSpdySession* session_; // Unowned. | 105 QuicSpdySession* session_; // Unowned. |
| 127 // The last packet number received. | 106 // The last packet number received. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // Receives notifications regarding the performance of the underlying socket | 165 // Receives notifications regarding the performance of the underlying socket |
| 187 // for the QUIC connection. May be null. | 166 // for the QUIC connection. May be null. |
| 188 const scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher_; | 167 const scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher_; |
| 189 | 168 |
| 190 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); | 169 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); |
| 191 }; | 170 }; |
| 192 | 171 |
| 193 } // namespace net | 172 } // namespace net |
| 194 | 173 |
| 195 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 174 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
| OLD | NEW |