• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef NET_QUIC_QUIC_CONNECTION_STATS_H_
6 #define NET_QUIC_QUIC_CONNECTION_STATS_H_
7 
8 #include <ostream>
9 
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
12 
13 namespace net {
14 // TODO(satyamshekhar): Add more interesting stats:
15 // 1. (C/S)HLO retransmission count.
16 // 2. SHLO received to first stream packet processed time.
17 // 3. CHLO sent to SHLO received time.
18 // 4. Number of migrations.
19 // 5. Number of out of order packets.
20 // 6. Number of connections that require more that 1-RTT.
21 // 7. Avg number of streams / session.
22 // 8. Number of duplicates received.
23 // 9. Fraction of data transferred that was padding.
24 
25 // Structure to hold stats for a QuicConnection.
26 struct NET_EXPORT_PRIVATE QuicConnectionStats {
27   QuicConnectionStats();
28   ~QuicConnectionStats();
29 
30   NET_EXPORT_PRIVATE friend std::ostream& operator<<(
31       std::ostream& os, const QuicConnectionStats& s);
32 
33   uint64 bytes_sent;  // includes retransmissions, fec.
34   uint32 packets_sent;
35   uint64 stream_bytes_sent;  // non-retransmitted bytes sent in a stream frame.
36 
37   uint64 bytes_received;  // includes duplicate data for a stream, fec.
38   uint32 packets_received;  // includes dropped packets
39   uint64 stream_bytes_received;  // bytes received in a stream frame.
40 
41   uint64 bytes_retransmitted;
42   uint32 packets_retransmitted;
43 
44   uint32 packets_revived;
45   uint32 packets_dropped;  // duplicate or less than least unacked.
46   uint32 rto_count;
47 
48   uint32 rtt;  // In microseconds
49   uint64 estimated_bandwidth;
50   // TODO(satyamshekhar): Add window_size, mss and mtu.
51 };
52 
53 }  // namespace net
54 
55 #endif  // NET_QUIC_QUIC_CONNECTION_STATS_H_
56