From 786a5fafa65bf9735f7e5060e126303307bb73bc Mon Sep 17 00:00:00 2001 From: "jar@google.com" Date: Mon, 5 Jan 2009 19:44:21 +0000 Subject: Histogram size of "final" block of SDCH compressed data. Sample/histogram the sizes of the "final" block of SDCH compressed data. Try to understand why there is a long tail in current distribution. bug=1561947 r=huanr,kenmixter,openvcdiff Review URL: http://codereview.chromium.org/17006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7552 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/sdch_filter.cc | 11 +++++++++-- net/base/sdch_filter.h | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'net/base') diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc index 4b9cf70..de15774 100644 --- a/net/base/sdch_filter.cc +++ b/net/base/sdch_filter.cc @@ -23,7 +23,8 @@ SdchFilter::SdchFilter() dest_buffer_excess_index_(0), source_bytes_(0), output_bytes_(0), - time_of_last_read_() { + time_of_last_read_(), + size_of_last_read_(0) { } SdchFilter::~SdchFilter() { @@ -54,6 +55,10 @@ SdchFilter::~SdchFilter() { if (PASS_THROUGH == decoding_status_) UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Transit_Pass-through_Latency_M", duration); + // Look at sizes of the 20% of blocks that arrive with large latency. + if (15 < duration.InSeconds()) + UMA_HISTOGRAM_COUNTS(L"Sdch.Transit_Belated_Final_Block_Size", + size_of_last_read_); } } @@ -92,8 +97,10 @@ Filter::FilterStatus SdchFilter::ReadFilteredData(char* dest_buffer, return FILTER_ERROR; // Don't update when we're called to just flush out our internal buffers. - if (next_stream_data_ && stream_data_len_ > 0) + if (next_stream_data_ && stream_data_len_ > 0) { time_of_last_read_ = base::Time::Now(); + size_of_last_read_ = stream_data_len_; + } if (WAITING_FOR_DICTIONARY_SELECTION == decoding_status_) { FilterStatus status = InitializeDictionary(); diff --git a/net/base/sdch_filter.h b/net/base/sdch_filter.h index 566d4d5..1c62202 100644 --- a/net/base/sdch_filter.h +++ b/net/base/sdch_filter.h @@ -99,7 +99,11 @@ class SdchFilter : public Filter { size_t source_bytes_; size_t output_bytes_; + // When was the most recent non-zero size data chunk processed? base::Time time_of_last_read_; + // How large was the most recent non-zero size data chunk? + int size_of_last_read_; + DISALLOW_COPY_AND_ASSIGN(SdchFilter); }; -- cgit v1.1