| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 largest_received_missing_packet_sequence_number_(0), | 332 largest_received_missing_packet_sequence_number_(0), |
| 333 num_out_of_order_received_packets_(0), | 333 num_out_of_order_received_packets_(0), |
| 334 num_packets_received_(0), | 334 num_packets_received_(0), |
| 335 num_truncated_acks_sent_(0), | 335 num_truncated_acks_sent_(0), |
| 336 num_truncated_acks_received_(0), | 336 num_truncated_acks_received_(0), |
| 337 num_frames_received_(0), | 337 num_frames_received_(0), |
| 338 num_duplicate_frames_received_(0), | 338 num_duplicate_frames_received_(0), |
| 339 num_incorrect_connection_ids_(0), | 339 num_incorrect_connection_ids_(0), |
| 340 num_undecryptable_packets_(0), | 340 num_undecryptable_packets_(0), |
| 341 num_duplicate_packets_(0), | 341 num_duplicate_packets_(0), |
| 342 num_blocked_frames_received_(0), |
| 343 num_blocked_frames_sent_(0), |
| 342 connection_description_(GetConnectionDescriptionString()) { | 344 connection_description_(GetConnectionDescriptionString()) { |
| 343 } | 345 } |
| 344 | 346 |
| 345 QuicConnectionLogger::~QuicConnectionLogger() { | 347 QuicConnectionLogger::~QuicConnectionLogger() { |
| 346 UMA_HISTOGRAM_COUNTS("Net.QuicSession.OutOfOrderPacketsReceived", | 348 UMA_HISTOGRAM_COUNTS("Net.QuicSession.OutOfOrderPacketsReceived", |
| 347 num_out_of_order_received_packets_); | 349 num_out_of_order_received_packets_); |
| 348 UMA_HISTOGRAM_COUNTS("Net.QuicSession.TruncatedAcksSent", | 350 UMA_HISTOGRAM_COUNTS("Net.QuicSession.TruncatedAcksSent", |
| 349 num_truncated_acks_sent_); | 351 num_truncated_acks_sent_); |
| 350 UMA_HISTOGRAM_COUNTS("Net.QuicSession.TruncatedAcksReceived", | 352 UMA_HISTOGRAM_COUNTS("Net.QuicSession.TruncatedAcksReceived", |
| 351 num_truncated_acks_received_); | 353 num_truncated_acks_received_); |
| 352 UMA_HISTOGRAM_COUNTS("Net.QuicSession.IncorrectConnectionIDsReceived", | 354 UMA_HISTOGRAM_COUNTS("Net.QuicSession.IncorrectConnectionIDsReceived", |
| 353 num_incorrect_connection_ids_); | 355 num_incorrect_connection_ids_); |
| 354 UMA_HISTOGRAM_COUNTS("Net.QuicSession.UndecryptablePacketsReceived", | 356 UMA_HISTOGRAM_COUNTS("Net.QuicSession.UndecryptablePacketsReceived", |
| 355 num_undecryptable_packets_); | 357 num_undecryptable_packets_); |
| 356 UMA_HISTOGRAM_COUNTS("Net.QuicSession.DuplicatePacketsReceived", | 358 UMA_HISTOGRAM_COUNTS("Net.QuicSession.DuplicatePacketsReceived", |
| 357 num_duplicate_packets_); | 359 num_duplicate_packets_); |
| 360 UMA_HISTOGRAM_COUNTS("Net.QuicSession.BlockedFrames.Received", |
| 361 num_blocked_frames_received_); |
| 362 UMA_HISTOGRAM_COUNTS("Net.QuicSession.BlockedFrames.Sent", |
| 363 num_blocked_frames_sent_); |
| 358 | 364 |
| 359 if (num_frames_received_ > 0) { | 365 if (num_frames_received_ > 0) { |
| 360 int duplicate_stream_frame_per_thousand = | 366 int duplicate_stream_frame_per_thousand = |
| 361 num_duplicate_frames_received_ * 1000 / num_frames_received_; | 367 num_duplicate_frames_received_ * 1000 / num_frames_received_; |
| 362 if (num_packets_received_ < 100) { | 368 if (num_packets_received_ < 100) { |
| 363 UMA_HISTOGRAM_CUSTOM_COUNTS( | 369 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 364 "Net.QuicSession.StreamFrameDuplicatedShortConnection", | 370 "Net.QuicSession.StreamFrameDuplicatedShortConnection", |
| 365 duplicate_stream_frame_per_thousand, 1, 1000, 75); | 371 duplicate_stream_frame_per_thousand, 1, 1000, 75); |
| 366 } else { | 372 } else { |
| 367 UMA_HISTOGRAM_CUSTOM_COUNTS( | 373 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 base::Bind(&NetLogQuicGoAwayFrameCallback, | 441 base::Bind(&NetLogQuicGoAwayFrameCallback, |
| 436 frame.goaway_frame)); | 442 frame.goaway_frame)); |
| 437 break; | 443 break; |
| 438 case WINDOW_UPDATE_FRAME: | 444 case WINDOW_UPDATE_FRAME: |
| 439 net_log_.AddEvent( | 445 net_log_.AddEvent( |
| 440 NetLog::TYPE_QUIC_SESSION_WINDOW_UPDATE_FRAME_SENT, | 446 NetLog::TYPE_QUIC_SESSION_WINDOW_UPDATE_FRAME_SENT, |
| 441 base::Bind(&NetLogQuicWindowUpdateFrameCallback, | 447 base::Bind(&NetLogQuicWindowUpdateFrameCallback, |
| 442 frame.window_update_frame)); | 448 frame.window_update_frame)); |
| 443 break; | 449 break; |
| 444 case BLOCKED_FRAME: | 450 case BLOCKED_FRAME: |
| 451 ++num_blocked_frames_sent_; |
| 445 net_log_.AddEvent( | 452 net_log_.AddEvent( |
| 446 NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_SENT, | 453 NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_SENT, |
| 447 base::Bind(&NetLogQuicBlockedFrameCallback, | 454 base::Bind(&NetLogQuicBlockedFrameCallback, |
| 448 frame.blocked_frame)); | 455 frame.blocked_frame)); |
| 449 break; | 456 break; |
| 450 case STOP_WAITING_FRAME: | 457 case STOP_WAITING_FRAME: |
| 451 net_log_.AddEvent( | 458 net_log_.AddEvent( |
| 452 NetLog::TYPE_QUIC_SESSION_STOP_WAITING_FRAME_SENT, | 459 NetLog::TYPE_QUIC_SESSION_STOP_WAITING_FRAME_SENT, |
| 453 base::Bind(&NetLogQuicStopWaitingFrameCallback, | 460 base::Bind(&NetLogQuicStopWaitingFrameCallback, |
| 454 frame.stop_waiting_frame)); | 461 frame.stop_waiting_frame)); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 } | 636 } |
| 630 | 637 |
| 631 void QuicConnectionLogger::OnWindowUpdateFrame( | 638 void QuicConnectionLogger::OnWindowUpdateFrame( |
| 632 const QuicWindowUpdateFrame& frame) { | 639 const QuicWindowUpdateFrame& frame) { |
| 633 net_log_.AddEvent( | 640 net_log_.AddEvent( |
| 634 NetLog::TYPE_QUIC_SESSION_WINDOW_UPDATE_FRAME_RECEIVED, | 641 NetLog::TYPE_QUIC_SESSION_WINDOW_UPDATE_FRAME_RECEIVED, |
| 635 base::Bind(&NetLogQuicWindowUpdateFrameCallback, &frame)); | 642 base::Bind(&NetLogQuicWindowUpdateFrameCallback, &frame)); |
| 636 } | 643 } |
| 637 | 644 |
| 638 void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) { | 645 void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) { |
| 646 ++num_blocked_frames_received_; |
| 639 net_log_.AddEvent( | 647 net_log_.AddEvent( |
| 640 NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_RECEIVED, | 648 NetLog::TYPE_QUIC_SESSION_BLOCKED_FRAME_RECEIVED, |
| 641 base::Bind(&NetLogQuicBlockedFrameCallback, &frame)); | 649 base::Bind(&NetLogQuicBlockedFrameCallback, &frame)); |
| 642 } | 650 } |
| 643 | 651 |
| 644 void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) { | 652 void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) { |
| 645 net_log_.AddEvent( | 653 net_log_.AddEvent( |
| 646 NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED, | 654 NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED, |
| 647 base::Bind(&NetLogQuicGoAwayFrameCallback, &frame)); | 655 base::Bind(&NetLogQuicGoAwayFrameCallback, &frame)); |
| 648 } | 656 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 continue; | 892 continue; |
| 885 } | 893 } |
| 886 // Record some overlapping patterns, to get a better picture, since this is | 894 // Record some overlapping patterns, to get a better picture, since this is |
| 887 // not very expensive. | 895 // not very expensive. |
| 888 if (i % 3 == 0) | 896 if (i % 3 == 0) |
| 889 six_packet_histogram->Add(recent_6_mask); | 897 six_packet_histogram->Add(recent_6_mask); |
| 890 } | 898 } |
| 891 } | 899 } |
| 892 | 900 |
| 893 } // namespace net | 901 } // namespace net |
| OLD | NEW |