Home | History | Annotate | Download | only in quic
      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       packets_discarded(0),
     16       bytes_received(0),
     17       packets_received(0),
     18       packets_processed(0),
     19       stream_bytes_received(0),
     20       bytes_retransmitted(0),
     21       packets_retransmitted(0),
     22       bytes_spuriously_retransmitted(0),
     23       packets_spuriously_retransmitted(0),
     24       packets_lost(0),
     25       slowstart_packets_lost(0),
     26       packets_revived(0),
     27       packets_dropped(0),
     28       crypto_retransmit_count(0),
     29       loss_timeout_count(0),
     30       tlp_count(0),
     31       rto_count(0),
     32       spurious_rto_count(0),
     33       min_rtt_us(0),
     34       srtt_us(0),
     35       max_packet_size(0),
     36       estimated_bandwidth(0),
     37       congestion_window(0),
     38       slow_start_threshold(0),
     39       packets_reordered(0),
     40       max_sequence_reordering(0),
     41       max_time_reordering_us(0),
     42       tcp_loss_events(0),
     43       cwnd_increase_congestion_avoidance(0),
     44       cwnd_increase_cubic_mode(0),
     45       connection_creation_time(QuicTime::Zero()) {
     46 }
     47 
     48 QuicConnectionStats::~QuicConnectionStats() {}
     49 
     50 ostream& operator<<(ostream& os, const QuicConnectionStats& s) {
     51   os << "{ bytes sent: " << s.bytes_sent
     52      << ", packets sent:" << s.packets_sent
     53      << ", stream bytes sent: " << s.stream_bytes_sent
     54      << ", packets discarded: " << s.packets_discarded
     55      << ", bytes received: " << s.bytes_received
     56      << ", packets received: " << s.packets_received
     57      << ", packets processed: " << s.packets_processed
     58      << ", stream bytes received: " << s.stream_bytes_received
     59      << ", bytes retransmitted: " << s.bytes_retransmitted
     60      << ", packets retransmitted: " << s.packets_retransmitted
     61      << ", bytes spuriously retransmitted: " << s.bytes_spuriously_retransmitted
     62      << ", packets spuriously retransmitted: "
     63      << s.packets_spuriously_retransmitted
     64      << ", packets lost: " << s.packets_lost
     65      << ", slowstart packets lost: " << s.slowstart_packets_lost
     66      << ", packets revived: " << s.packets_revived
     67      << ", packets dropped:" << s.packets_dropped
     68      << ", crypto retransmit count: " << s.crypto_retransmit_count
     69      << ", tlp count: " << s.tlp_count
     70      << ", rto count: " << s.rto_count
     71      << ", spurious_rto_count:" << s.spurious_rto_count
     72      << ", min_rtt(us): " << s.min_rtt_us
     73      << ", srtt(us): " << s.srtt_us
     74      << ", max packet size: " << s.max_packet_size
     75      << ", estimated bandwidth: " << s.estimated_bandwidth
     76      << ", congestion window: " << s.congestion_window
     77      << ", slow start threshold: " << s.slow_start_threshold
     78      << ", tcp_loss_events: " << s.tcp_loss_events
     79      << ", packets reordered: " << s.packets_reordered
     80      << ", max sequence reordering: " << s.max_sequence_reordering
     81      << ", max time reordering(us): " << s.max_time_reordering_us
     82      << ", total amount of cwnd increase in TCPCubic, in congestion avoidance: "
     83      << s.cwnd_increase_congestion_avoidance
     84      << ", amount of cwnd increase in TCPCubic, in cubic mode: "
     85      << s.cwnd_increase_cubic_mode
     86      << "}\n";
     87   return os;
     88 }
     89 
     90 }  // namespace net
     91