Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: net/quic/quic_connection_logger.cc

Issue 1775233002: Add histogram to log whether a QuicGoAwayFrame is received for connection migration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
14 #include "base/metrics/sparse_histogram.h" 14 #include "base/metrics/sparse_histogram.h"
15 #include "base/profiler/scoped_tracker.h" 15 #include "base/profiler/scoped_tracker.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "net/base/ip_address.h" 18 #include "net/base/ip_address.h"
19 #include "net/cert/cert_verify_result.h" 19 #include "net/cert/cert_verify_result.h"
20 #include "net/cert/x509_certificate.h" 20 #include "net/cert/x509_certificate.h"
21 #include "net/log/net_log.h" 21 #include "net/log/net_log.h"
22 #include "net/quic/crypto/crypto_handshake_message.h" 22 #include "net/quic/crypto/crypto_handshake_message.h"
23 #include "net/quic/crypto/crypto_protocol.h" 23 #include "net/quic/crypto/crypto_protocol.h"
24 #include "net/quic/quic_address_mismatch.h" 24 #include "net/quic/quic_address_mismatch.h"
25 #include "net/quic/quic_protocol.h"
25 #include "net/quic/quic_socket_address_coder.h" 26 #include "net/quic/quic_socket_address_coder.h"
26 #include "net/quic/quic_time.h" 27 #include "net/quic/quic_time.h"
27 28
28 using base::StringPiece; 29 using base::StringPiece;
29 using std::string; 30 using std::string;
30 31
31 namespace net { 32 namespace net {
32 33
33 namespace { 34 namespace {
34 35
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 base::Bind(&NetLogQuicWindowUpdateFrameCallback, &frame)); 607 base::Bind(&NetLogQuicWindowUpdateFrameCallback, &frame));
607 } 608 }
608 609
609 void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) { 610 void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) {
610 ++num_blocked_frames_received_; 611 ++num_blocked_frames_received_;
611 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_RECEIVED, 612 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_RECEIVED,
612 base::Bind(&NetLogQuicBlockedFrameCallback, &frame)); 613 base::Bind(&NetLogQuicBlockedFrameCallback, &frame));
613 } 614 }
614 615
615 void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) { 616 void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
617 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.GoAwayReceivedForConnectionMigration",
618 frame.error_code == QUIC_ERROR_MIGRATING_PORT);
619
616 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED, 620 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED,
617 base::Bind(&NetLogQuicGoAwayFrameCallback, &frame)); 621 base::Bind(&NetLogQuicGoAwayFrameCallback, &frame));
618 } 622 }
619 623
620 void QuicConnectionLogger::OnPingFrame(const QuicPingFrame& frame) { 624 void QuicConnectionLogger::OnPingFrame(const QuicPingFrame& frame) {
621 // PingFrame has no contents to log, so just record that it was received. 625 // PingFrame has no contents to log, so just record that it was received.
622 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_RECEIVED); 626 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_RECEIVED);
623 } 627 }
624 628
625 void QuicConnectionLogger::OnPublicResetPacket( 629 void QuicConnectionLogger::OnPublicResetPacket(
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 continue; 875 continue;
872 } 876 }
873 // Record some overlapping patterns, to get a better picture, since this is 877 // Record some overlapping patterns, to get a better picture, since this is
874 // not very expensive. 878 // not very expensive.
875 if (i % 3 == 0) 879 if (i % 3 == 0)
876 six_packet_histogram->Add(recent_6_mask); 880 six_packet_histogram->Add(recent_6_mask);
877 } 881 }
878 } 882 }
879 883
880 } // namespace net 884 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698