1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_QUIC_QUIC_CONNECTION_STATS_H_
6 #define NET_QUIC_QUIC_CONNECTION_STATS_H_
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
12 #include "net/quic/quic_bandwidth.h"
13 #include "net/quic/quic_protocol.h"
14 #include "net/quic/quic_time.h"
17 // Structure to hold stats for a QuicConnection.
18 struct NET_EXPORT_PRIVATE QuicConnectionStats
{
19 QuicConnectionStats();
20 ~QuicConnectionStats();
22 NET_EXPORT_PRIVATE
friend std::ostream
& operator<<(
23 std::ostream
& os
, const QuicConnectionStats
& s
);
25 QuicByteCount bytes_sent
; // Includes retransmissions, fec.
26 QuicPacketCount packets_sent
;
27 // Non-retransmitted bytes sent in a stream frame.
28 QuicByteCount stream_bytes_sent
;
29 // Packets serialized and discarded before sending.
30 QuicPacketCount packets_discarded
;
32 // These include version negotiation and public reset packets, which do not
33 // have packet numbers or frame data.
34 QuicByteCount bytes_received
; // Includes duplicate data for a stream, fec.
35 // Includes packets which were not processable.
36 QuicPacketCount packets_received
;
37 // Excludes packets which were not processable.
38 QuicPacketCount packets_processed
;
39 QuicByteCount stream_bytes_received
; // Bytes received in a stream frame.
41 QuicByteCount bytes_retransmitted
;
42 QuicPacketCount packets_retransmitted
;
44 QuicByteCount bytes_spuriously_retransmitted
;
45 QuicPacketCount packets_spuriously_retransmitted
;
46 // Number of packets abandoned as lost by the loss detection algorithm.
47 QuicPacketCount packets_lost
;
49 // Number of packets sent in slow start.
50 QuicPacketCount slowstart_packets_sent
;
51 // Number of packets lost exiting slow start.
52 QuicPacketCount slowstart_packets_lost
;
54 QuicPacketCount packets_revived
;
55 QuicPacketCount packets_dropped
; // Duplicate or less than least unacked.
56 size_t crypto_retransmit_count
;
57 // Count of times the loss detection alarm fired. At least one packet should
58 // be lost when the alarm fires.
59 size_t loss_timeout_count
;
61 size_t rto_count
; // Count of times the rto timer fired.
63 int64 min_rtt_us
; // Minimum RTT in microseconds.
64 int64 srtt_us
; // Smoothed RTT in microseconds.
65 QuicByteCount max_packet_size
;
66 QuicByteCount max_received_packet_size
;
67 QuicBandwidth estimated_bandwidth
;
69 // Reordering stats for received packets.
70 // Number of packets received out of packet number order.
71 QuicPacketCount packets_reordered
;
72 // Maximum reordering observed in packet number space.
73 QuicPacketNumber max_sequence_reordering
;
74 // Maximum reordering observed in microseconds
75 int64 max_time_reordering_us
;
77 // The following stats are used only in TcpCubicSender.
78 // The number of loss events from TCP's perspective. Each loss event includes
79 // one or more lost packets.
80 uint32 tcp_loss_events
;
82 // Creation time, as reported by the QuicClock.
83 QuicTime connection_creation_time
;
88 #endif // NET_QUIC_QUIC_CONNECTION_STATS_H_