Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / net / quic / quic_connection_stats.cc
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 #include "net/quic/quic_connection_stats.h"
6
7 using std::ostream;
8
9 namespace net {
10
11 QuicConnectionStats::QuicConnectionStats()
12     : bytes_sent(0),
13       packets_sent(0),
14       stream_bytes_sent(0),
15       bytes_received(0),
16       packets_received(0),
17       stream_bytes_received(0),
18       bytes_retransmitted(0),
19       packets_retransmitted(0),
20       packets_spuriously_retransmitted(0),
21       packets_lost(0),
22       packets_revived(0),
23       packets_dropped(0),
24       crypto_retransmit_count(0),
25       loss_timeout_count(0),
26       tlp_count(0),
27       rto_count(0),
28       rtt(0),
29       estimated_bandwidth(0),
30       cwnd_increase_congestion_avoidance(0),
31       cwnd_increase_cubic_mode(0) {
32 }
33
34 QuicConnectionStats::~QuicConnectionStats() {}
35
36 ostream& operator<<(ostream& os, const QuicConnectionStats& s) {
37   os << "{ bytes sent: " << s.bytes_sent
38      << ", packets sent:" << s.packets_sent
39      << ", stream bytes sent: " << s.stream_bytes_sent
40      << ", bytes received: " << s.bytes_received
41      << ", packets received: " << s.packets_received
42      << ", stream bytes received: " << s.stream_bytes_received
43      << ", bytes retransmitted: " << s.bytes_retransmitted
44      << ", packets retransmitted: " << s.packets_retransmitted
45      << ", packets_spuriously_retransmitted: "
46      << s.packets_spuriously_retransmitted
47      << ", packets lost: " << s.packets_lost
48      << ", packets revived: " << s.packets_revived
49      << ", packets dropped:" << s.packets_dropped
50      << ", crypto retransmit count: " << s.crypto_retransmit_count
51      << ", rto count: " << s.rto_count
52      << ", tlp count: " << s.tlp_count
53      << ", rtt(us): " << s.rtt
54      << ", estimated_bandwidth: " << s.estimated_bandwidth
55      << ", total amount of cwnd increase in TCPCubic, in congestion avoidance: "
56      << s.cwnd_increase_congestion_avoidance
57      << ", amount of cwnd increase in TCPCubic, in cubic mode: "
58      << s.cwnd_increase_cubic_mode
59      << "}\n";
60   return os;
61 }
62
63 }  // namespace net