| 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 <limits> | 8 #include <limits> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 net_log_.AddEvent( | 456 net_log_.AddEvent( |
| 457 NetLog::TYPE_QUIC_SESSION_PACKET_RETRANSMITTED, | 457 NetLog::TYPE_QUIC_SESSION_PACKET_RETRANSMITTED, |
| 458 base::Bind(&NetLogQuicPacketRetransmittedCallback, | 458 base::Bind(&NetLogQuicPacketRetransmittedCallback, |
| 459 original_packet_number, serialized_packet.packet_number)); | 459 original_packet_number, serialized_packet.packet_number)); |
| 460 } | 460 } |
| 461 // Record time duration from last packet sent to the new packet sent. | 461 // Record time duration from last packet sent to the new packet sent. |
| 462 if (last_packet_sent_time_.IsInitialized()) { | 462 if (last_packet_sent_time_.IsInitialized()) { |
| 463 UMA_HISTOGRAM_CUSTOM_TIMES( | 463 UMA_HISTOGRAM_CUSTOM_TIMES( |
| 464 "Net.QuicTimeBetweenTwoPacketSent", | 464 "Net.QuicTimeBetweenTwoPacketSent", |
| 465 base::TimeDelta::FromMilliseconds( | 465 base::TimeDelta::FromMilliseconds( |
| 466 sent_time.Subtract(last_packet_sent_time_).ToMilliseconds()), | 466 (sent_time - last_packet_sent_time_).ToMilliseconds()), |
| 467 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), | 467 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10), |
| 468 100); | 468 100); |
| 469 } | 469 } |
| 470 last_packet_sent_time_ = sent_time; | 470 last_packet_sent_time_ = sent_time; |
| 471 } | 471 } |
| 472 | 472 |
| 473 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address, | 473 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address, |
| 474 const IPEndPoint& peer_address, | 474 const IPEndPoint& peer_address, |
| 475 const QuicEncryptedPacket& packet) { | 475 const QuicEncryptedPacket& packet) { |
| 476 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) { | 476 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 continue; | 889 continue; |
| 890 } | 890 } |
| 891 // Record some overlapping patterns, to get a better picture, since this is | 891 // Record some overlapping patterns, to get a better picture, since this is |
| 892 // not very expensive. | 892 // not very expensive. |
| 893 if (i % 3 == 0) | 893 if (i % 3 == 0) |
| 894 six_packet_histogram->Add(recent_6_mask); | 894 six_packet_histogram->Add(recent_6_mask); |
| 895 } | 895 } |
| 896 } | 896 } |
| 897 | 897 |
| 898 } // namespace net | 898 } // namespace net |
| OLD | NEW |