From 87a1a958cd1a99a57bb28d242e244411a5f39cfa Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Tue, 13 Jan 2009 18:06:03 +0000 Subject: Correct latency histograms for SDCH encoding Add a boolean to indicate if the request_time_ was set via a call to Now(), vs unpickling from the cache, so that cached results can be excluded from latency measurements. bug=1561947 r=darin,rvargas Review URL: http://codereview.chromium.org/17371 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7942 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/sdch_filter.cc | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'net/base') diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc index de15774..2113ebd 100644 --- a/net/base/sdch_filter.cc +++ b/net/base/sdch_filter.cc @@ -41,24 +41,18 @@ SdchFilter::~SdchFilter() { if (base::Time() != connect_time() && base::Time() != time_of_last_read_) { base::TimeDelta duration = time_of_last_read_ - connect_time(); - // Note: connect_time may be somewhat incorrect if this is cached data, as - // it will reflect the time the connect was done for the original read :-(. - // To avoid any chances of overflow, and since SDCH is meant to primarilly - // handle short downloads, we'll restrict what results we log to effectively - // discard bogus large numbers. Note that IF the number is large enough, it - // would DCHECK in histogram as the square of the value is summed. The - // relatively precise histogram only properly covers the range 1ms to 10 + // Note: connect_time is *only* set if this was NOT cached data, so the + // latency duration should only apply to the network read of the content. + // We clip our logging at 10 minutes to prevent anamolous data from being + // considered (per suggestion from Jake Brutlag). + // The relatively precise histogram only properly covers the range 1ms to 10 // seconds, so the discarded data would not be that readable anyway. - if (180 >= duration.InSeconds()) { + if (10 >= duration.InMinutes()) { if (DECODING_IN_PROGRESS == decoding_status_) - UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Transit_Latency_M", duration); + UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Network_Decode_Latency_M", duration); if (PASS_THROUGH == decoding_status_) - UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Transit_Pass-through_Latency_M", + UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Network_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_); } } -- cgit v1.1