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

Unified Diff: net/quic/quic_connection_logger.cc

Issue 1889413002: Remove unused histograms: Net.QuicSession.21* & Net.QuicSession.6* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@REMOVE_HISTOGRAMS
Patch Set: mark histograms as obsolete Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection_logger.cc
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index b9cb00e322321d88847f6020af70795935d78201..427e1a4e97a08a72737458ab86a9f711ff9508da 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -33,11 +33,6 @@ namespace net {
namespace {
-// We have ranges-of-buckets in the cumulative histogram (covering 21 packet
-// sequences) of length 2, 3, 4, ... 22.
-// Hence the largest sample is bounded by the sum of those numbers.
-const int kBoundingSampleInCumulativeHistogram = ((2 + 22) * 21) / 2;
-
scoped_ptr<base::Value> NetLogQuicPacketCallback(
const IPEndPoint* self_address,
const IPEndPoint* peer_address,
@@ -709,60 +704,6 @@ base::HistogramBase* QuicConnectionLogger::GetPacketNumberHistogram(
base::HistogramBase::kUmaTargetedHistogramFlag);
}
-base::HistogramBase* QuicConnectionLogger::Get6PacketHistogram(
- const char* which_6) const {
- // This histogram takes a binary encoding of the 6 consecutive packets
- // received. As a result, there are 64 possible sample-patterns.
- string prefix("Net.QuicSession.6PacketsPatternsReceived_");
- return base::LinearHistogram::FactoryGet(
- prefix + which_6 + connection_description_, 1, 64, 65,
- base::HistogramBase::kUmaTargetedHistogramFlag);
-}
-
-base::HistogramBase* QuicConnectionLogger::Get21CumulativeHistogram(
- const char* which_21) const {
- // This histogram contains, for each sequence of 21 packets, the results from
- // 21 distinct questions about that sequence. Conceptually the histogtram is
- // broken into 21 distinct ranges, and one sample is added into each of those
- // ranges whenever we process a set of 21 packets.
- // There is a little rendundancy, as each "range" must have the same number
- // of samples, all told, but the histogram is a tad easier to read this way.
- // The questions are:
- // Was the first packet present (bucket 0==>no; bucket 1==>yes)
- // Of the first two packets, how many were present? (bucket 2==> none;
- // bucket 3==> 1 of 2; bucket 4==> 2 of 2)
- // Of the first three packets, how many were present? (bucket 5==>none;
- // bucket 6==> 1 of 3; bucket 7==> 2 of 3; bucket 8==> 3 of 3).
- // etc.
- string prefix("Net.QuicSession.21CumulativePacketsReceived_");
- return base::LinearHistogram::FactoryGet(
- prefix + which_21 + connection_description_, 1,
- kBoundingSampleInCumulativeHistogram,
- kBoundingSampleInCumulativeHistogram + 1,
- base::HistogramBase::kUmaTargetedHistogramFlag);
-}
-
-// static
-void QuicConnectionLogger::AddTo21CumulativeHistogram(
- base::HistogramBase* histogram,
- int bit_mask_of_packets,
- int valid_bits_in_mask) {
- DCHECK_LE(valid_bits_in_mask, 21);
- DCHECK_LT(bit_mask_of_packets, 1 << 21);
- const int blank_bits_in_mask = 21 - valid_bits_in_mask;
- DCHECK_EQ(bit_mask_of_packets & ((1 << blank_bits_in_mask) - 1), 0);
- bit_mask_of_packets >>= blank_bits_in_mask;
- int bits_so_far = 0;
- int range_start = 0;
- for (int i = 1; i <= valid_bits_in_mask; ++i) {
- bits_so_far += bit_mask_of_packets & 1;
- bit_mask_of_packets >>= 1;
- DCHECK_LT(range_start + bits_so_far, kBoundingSampleInCumulativeHistogram);
- histogram->Add(range_start + bits_so_far);
- range_start += i + 1;
- }
-}
-
float QuicConnectionLogger::ReceivedPacketLossRate() const {
if (largest_received_packet_number_ <= num_packets_received_)
return 0.0f;
@@ -813,17 +754,10 @@ void QuicConnectionLogger::RecordLossHistograms() const {
GetPacketNumberHistogram("Ack_");
base::HistogramBase* packet_missing_histogram =
GetPacketNumberHistogram("Nack_");
- base::HistogramBase* ongoing_cumulative_packet_histogram =
- Get21CumulativeHistogram("Some21s_");
- base::HistogramBase* first_cumulative_packet_histogram =
- Get21CumulativeHistogram("First21_");
- base::HistogramBase* six_packet_histogram = Get6PacketHistogram("Some6s_");
DCHECK_EQ(received_packets_.size(), received_acks_.size());
const QuicPacketNumber last_index = std::min<QuicPacketNumber>(
received_packets_.size() - 1, largest_received_packet_number_);
- const QuicPacketNumber index_of_first_21_contribution =
- std::min<QuicPacketNumber>(21, last_index);
// Bit pattern of consecutively received packets that is maintained as we scan
// through the received_packets_ vector. Less significant bits correspond to
// less recent packets, and only the low order 21 bits are ever defined.
@@ -845,29 +779,13 @@ void QuicConnectionLogger::RecordLossHistograms() const {
packet_missing_histogram->Add(i);
}
- if (i == index_of_first_21_contribution) {
- AddTo21CumulativeHistogram(first_cumulative_packet_histogram,
- packet_pattern_21, i);
- }
- // We'll just record for non-overlapping ranges, to reduce histogramming
- // cost for now. Each call does 21 separate histogram additions.
- if (i > 21 || i % 21 == 0) {
- AddTo21CumulativeHistogram(ongoing_cumulative_packet_histogram,
- packet_pattern_21, 21);
- }
-
if (i < 6)
continue; // Not enough packets to do any pattern recording.
int recent_6_mask = packet_pattern_21 >> 15;
DCHECK_LT(recent_6_mask, 64);
if (i == 6) {
- Get6PacketHistogram("First6_")->Add(recent_6_mask);
continue;
}
- // Record some overlapping patterns, to get a better picture, since this is
- // not very expensive.
- if (i % 3 == 0)
- six_packet_histogram->Add(recent_6_mask);
}
}

Powered by Google App Engine
This is Rietveld 408576698