summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 18:06:03 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 18:06:03 +0000
commit87a1a958cd1a99a57bb28d242e244411a5f39cfa (patch)
tree04e97186d459fd2430adc8a7b3cd1e7cf5120f66 /net/base
parent5cbb127e6b67a646b98a460faf89740f29b91403 (diff)
downloadchromium_src-87a1a958cd1a99a57bb28d242e244411a5f39cfa.zip
chromium_src-87a1a958cd1a99a57bb28d242e244411a5f39cfa.tar.gz
chromium_src-87a1a958cd1a99a57bb28d242e244411a5f39cfa.tar.bz2
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
Diffstat (limited to 'net/base')
-rw-r--r--net/base/sdch_filter.cc22
1 files changed, 8 insertions, 14 deletions
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_);
}
}