From 7cde50e9d748c56c8c2b1a99d00816df810a6df3 Mon Sep 17 00:00:00 2001 From: rch Date: Wed, 18 Feb 2015 15:33:03 -0800 Subject: [PATCH] Add a new histogram Net.QuicSession.HeadersStreamEarlyFramesReceived for tracking the frames received on the headers stream which arrived early. Review URL: https://codereview.chromium.org/937803002 Cr-Commit-Position: refs/heads/master@{#316916} --- net/quic/quic_connection_logger.cc | 2 ++ net/quic/quic_connection_logger_unittest.cc | 5 ++++- net/quic/quic_session.h | 2 ++ net/quic/reliable_quic_stream.cc | 4 ++++ net/quic/reliable_quic_stream.h | 2 +- tools/metrics/histograms/histograms.xml | 7 +++++++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc index 8a9c3a711181..e1c02238acf3 100644 --- a/net/quic/quic_connection_logger.cc +++ b/net/quic/quic_connection_logger.cc @@ -369,6 +369,8 @@ QuicConnectionLogger::~QuicConnectionLogger() { num_blocked_frames_received_); UMA_HISTOGRAM_COUNTS("Net.QuicSession.BlockedFrames.Sent", num_blocked_frames_sent_); + UMA_HISTOGRAM_COUNTS("Net.QuicSession.HeadersStream.EarlyFramesReceived", + session_->headers_stream()->num_early_frames_received()); if (num_frames_received_ > 0) { int duplicate_stream_frame_per_thousand = diff --git a/net/quic/quic_connection_logger_unittest.cc b/net/quic/quic_connection_logger_unittest.cc index dbba7d711870..739267279779 100644 --- a/net/quic/quic_connection_logger_unittest.cc +++ b/net/quic/quic_connection_logger_unittest.cc @@ -5,6 +5,7 @@ #include "net/quic/quic_connection_logger.h" #include "net/quic/quic_protocol.h" +#include "net/quic/test_tools/quic_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { @@ -19,9 +20,11 @@ class QuicConnectionLoggerPeer { class QuicConnectionLoggerTest : public ::testing::Test { protected: - QuicConnectionLoggerTest() : logger_(nullptr, net_log_) {} + QuicConnectionLoggerTest() + : session_(new MockConnection(false)), logger_(&session_, net_log_) {} BoundNetLog net_log_; + MockSession session_; QuicConnectionLogger logger_; }; diff --git a/net/quic/quic_session.h b/net/quic/quic_session.h index 0d20b9b28157..15712f08f4bc 100644 --- a/net/quic/quic_session.h +++ b/net/quic/quic_session.h @@ -219,6 +219,8 @@ class NET_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface { size_t get_max_open_streams() const { return max_open_streams_; } + const QuicHeadersStream* headers_stream() { return headers_stream_.get(); } + protected: typedef base::hash_map DataStreamMap; diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc index 379991e82264..8f34cf5e796a 100644 --- a/net/quic/reliable_quic_stream.cc +++ b/net/quic/reliable_quic_stream.cc @@ -181,6 +181,10 @@ int ReliableQuicStream::num_frames_received() const { return sequencer_.num_frames_received(); } +int ReliableQuicStream::num_early_frames_received() const { + return sequencer_.num_early_frames_received(); +} + int ReliableQuicStream::num_duplicate_frames_received() const { return sequencer_.num_duplicate_frames_received(); } diff --git a/net/quic/reliable_quic_stream.h b/net/quic/reliable_quic_stream.h index 93ad0c695fc4..5757d8dd47e3 100644 --- a/net/quic/reliable_quic_stream.h +++ b/net/quic/reliable_quic_stream.h @@ -97,7 +97,7 @@ class NET_EXPORT_PRIVATE ReliableQuicStream { virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame); int num_frames_received() const; - + int num_early_frames_received() const; int num_duplicate_frames_received() const; QuicFlowController* flow_controller() { return &flow_controller_; } diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index bc94c61a0695..5b1aadc4e436 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -18821,6 +18821,13 @@ Therefore, the affected-histogram name has to have at least one dot in it. + + rch@chromium.org + + The frames received on the headers stream which arrived early. + + + rch@chromium.org -- 2.11.4.GIT