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

Side by Side Diff: net/quic/quic_connection_logger.h

Issue 180833004: Gather histogram for received packets indicating losses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to comments, and add small optimization Created 6 years, 9 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 | « no previous file | net/quic/quic_connection_logger.cc » ('j') | net/quic/quic_connection_logger.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <bitset>
9
8 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
11 #include "net/base/network_change_notifier.h"
9 #include "net/quic/quic_connection.h" 12 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_protocol.h" 13 #include "net/quic/quic_protocol.h"
11 14
12 namespace net { 15 namespace net {
13 16
14 class CryptoHandshakeMessage; 17 class CryptoHandshakeMessage;
15 18
16 // This class is a debug visitor of a QuicConnection which logs 19 // This class is a debug visitor of a QuicConnection which logs
17 // events to |net_log|. 20 // events to |net_log|.
18 class NET_EXPORT_PRIVATE QuicConnectionLogger 21 class NET_EXPORT_PRIVATE QuicConnectionLogger
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 base::StringPiece payload) OVERRIDE; 56 base::StringPiece payload) OVERRIDE;
54 57
55 void OnCryptoHandshakeMessageReceived( 58 void OnCryptoHandshakeMessageReceived(
56 const CryptoHandshakeMessage& message); 59 const CryptoHandshakeMessage& message);
57 void OnCryptoHandshakeMessageSent( 60 void OnCryptoHandshakeMessageSent(
58 const CryptoHandshakeMessage& message); 61 const CryptoHandshakeMessage& message);
59 void OnConnectionClosed(QuicErrorCode error, bool from_peer); 62 void OnConnectionClosed(QuicErrorCode error, bool from_peer);
60 void OnSuccessfulVersionNegotiation(const QuicVersion& version); 63 void OnSuccessfulVersionNegotiation(const QuicVersion& version);
61 64
62 private: 65 private:
66 // At destruction time, this records results of |pacaket_received_| into
67 // histograms for specific connection types.
68 void RecordAckNackHistograms();
69
70 // The number of packets for which status is recorded.
71 const static size_t MAX_PACKET_STATUS = 100;
72
63 BoundNetLog net_log_; 73 BoundNetLog net_log_;
64 // The last packet sequence number received. 74 // The last packet sequence number received.
65 QuicPacketSequenceNumber last_received_packet_sequence_number_; 75 QuicPacketSequenceNumber last_received_packet_sequence_number_;
66 // The largest packet sequence number received. In case of that a packet is 76 // The largest packet sequence number received. In case of that a packet is
67 // received late, this value will not be updated. 77 // received late, this value will not be updated.
68 QuicPacketSequenceNumber largest_received_packet_sequence_number_; 78 QuicPacketSequenceNumber largest_received_packet_sequence_number_;
69 // The largest packet sequence number which the peer has failed to 79 // The largest packet sequence number which the peer has failed to
70 // receive, according to the missing packet set in their ack frames. 80 // receive, according to the missing packet set in their ack frames.
71 QuicPacketSequenceNumber largest_received_missing_packet_sequence_number_; 81 QuicPacketSequenceNumber largest_received_missing_packet_sequence_number_;
72 // Number of times that the current received packet sequence number is 82 // Number of times that the current received packet sequence number is
73 // smaller than the last received packet sequence number. 83 // smaller than the last received packet sequence number.
74 size_t out_of_order_recieved_packet_count_; 84 size_t out_of_order_recieved_packet_count_;
75 // Number of times a truncated ACK frame was sent. 85 // Number of times a truncated ACK frame was sent.
76 size_t num_truncated_acks_sent_; 86 size_t num_truncated_acks_sent_;
77 // Number of times a truncated ACK frame was received. 87 // Number of times a truncated ACK frame was received.
78 size_t num_truncated_acks_received_; 88 size_t num_truncated_acks_received_;
79 // The kCADR value provided by the server in ServerHello. 89 // The kCADR value provided by the server in ServerHello.
80 IPEndPoint client_address_; 90 IPEndPoint client_address_;
91 // Vector of inital packets status', where false means never received.
92 std::bitset<MAX_PACKET_STATUS> packets_received_;
93 // The available type of connection (WiFi, 3G, etc.) when connection was first
94 // used.
95 NetworkChangeNotifier::ConnectionType connection_type_;
81 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); 96 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger);
82 }; 97 };
83 98
84 } // namespace net 99 } // namespace net
85 100
86 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ 101 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_connection_logger.cc » ('j') | net/quic/quic_connection_logger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698