OLD | NEW |
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 #include "net/quic/quic_connection_logger.h" | 5 #include "net/quic/quic_connection_logger.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 dict->SetString("offset", base::Uint64ToString(frame->offset)); | 99 dict->SetString("offset", base::Uint64ToString(frame->offset)); |
100 dict->SetInteger("length", frame->data.TotalBufferSize()); | 100 dict->SetInteger("length", frame->data.TotalBufferSize()); |
101 return dict; | 101 return dict; |
102 } | 102 } |
103 | 103 |
104 base::Value* NetLogQuicAckFrameCallback(const QuicAckFrame* frame, | 104 base::Value* NetLogQuicAckFrameCallback(const QuicAckFrame* frame, |
105 NetLog::LogLevel /* log_level */) { | 105 NetLog::LogLevel /* log_level */) { |
106 base::DictionaryValue* dict = new base::DictionaryValue(); | 106 base::DictionaryValue* dict = new base::DictionaryValue(); |
107 dict->SetString("largest_observed", | 107 dict->SetString("largest_observed", |
108 base::Uint64ToString(frame->largest_observed)); | 108 base::Uint64ToString(frame->largest_observed)); |
| 109 dict->SetInteger("delta_time_largest_observed_us", |
| 110 frame->delta_time_largest_observed.ToMicroseconds()); |
| 111 dict->SetInteger("entropy_hash", |
| 112 frame->entropy_hash); |
109 dict->SetBoolean("truncated", frame->is_truncated); | 113 dict->SetBoolean("truncated", frame->is_truncated); |
| 114 |
110 base::ListValue* missing = new base::ListValue(); | 115 base::ListValue* missing = new base::ListValue(); |
111 dict->Set("missing_packets", missing); | 116 dict->Set("missing_packets", missing); |
112 const SequenceNumberSet& missing_packets = frame->missing_packets; | 117 const SequenceNumberSet& missing_packets = frame->missing_packets; |
113 for (SequenceNumberSet::const_iterator it = missing_packets.begin(); | 118 for (SequenceNumberSet::const_iterator it = missing_packets.begin(); |
114 it != missing_packets.end(); ++it) { | 119 it != missing_packets.end(); ++it) { |
115 missing->AppendString(base::Uint64ToString(*it)); | 120 missing->AppendString(base::Uint64ToString(*it)); |
116 } | 121 } |
| 122 |
| 123 base::ListValue* revived = new base::ListValue(); |
| 124 dict->Set("revived_packets", revived); |
| 125 const SequenceNumberSet& revived_packets = frame->revived_packets; |
| 126 for (SequenceNumberSet::const_iterator it = revived_packets.begin(); |
| 127 it != revived_packets.end(); ++it) { |
| 128 revived->AppendString(base::Uint64ToString(*it)); |
| 129 } |
| 130 |
| 131 base::ListValue* received = new base::ListValue(); |
| 132 dict->Set("received_packet_times", received); |
| 133 const PacketTimeList& received_times = frame->received_packet_times; |
| 134 for (PacketTimeList::const_iterator it = received_times.begin(); |
| 135 it != received_times.end(); ++it) { |
| 136 base::DictionaryValue* info = new base::DictionaryValue(); |
| 137 info->SetInteger("sequence_number", it->first); |
| 138 info->SetInteger("received", it->second.ToDebuggingValue()); |
| 139 revived->Append(info); |
| 140 } |
| 141 |
117 return dict; | 142 return dict; |
118 } | 143 } |
119 | 144 |
120 base::Value* NetLogQuicCongestionFeedbackFrameCallback( | 145 base::Value* NetLogQuicCongestionFeedbackFrameCallback( |
121 const QuicCongestionFeedbackFrame* frame, | 146 const QuicCongestionFeedbackFrame* frame, |
122 NetLog::LogLevel /* log_level */) { | 147 NetLog::LogLevel /* log_level */) { |
123 base::DictionaryValue* dict = new base::DictionaryValue(); | 148 base::DictionaryValue* dict = new base::DictionaryValue(); |
124 switch (frame->type) { | 149 switch (frame->type) { |
125 case kTCP: | 150 case kTCP: |
126 dict->SetString("type", "TCP"); | 151 dict->SetString("type", "TCP"); |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 continue; | 877 continue; |
853 } | 878 } |
854 // Record some overlapping patterns, to get a better picture, since this is | 879 // Record some overlapping patterns, to get a better picture, since this is |
855 // not very expensive. | 880 // not very expensive. |
856 if (i % 3 == 0) | 881 if (i % 3 == 0) |
857 six_packet_histogram->Add(recent_6_mask); | 882 six_packet_histogram->Add(recent_6_mask); |
858 } | 883 } |
859 } | 884 } |
860 | 885 |
861 } // namespace net | 886 } // namespace net |
OLD | NEW |