diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-16 22:14:47 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-16 22:14:47 +0000 |
commit | 4a65637a73afc2ae43c2b8a8880b36e513b765a0 (patch) | |
tree | ced29a9f23b367cf207256d2fb91ab29dfbf1532 /extensions | |
parent | f76dc353b84dcdd78de944db874424c4f4b14b95 (diff) | |
download | chromium_src-4a65637a73afc2ae43c2b8a8880b36e513b765a0.zip chromium_src-4a65637a73afc2ae43c2b8a8880b36e513b765a0.tar.gz chromium_src-4a65637a73afc2ae43c2b8a8880b36e513b765a0.tar.bz2 |
Break a single histogram into two histograms
This histogram records a networking result that if positive indicates a
byte count, and if negative indicates an error code. Since histograms
can't handle negative values, this splits that up into two: one for the
byte count, and one that will use an existing enum for the network
error code.
This was based off of a suggestion in codereview.chromium.org/236023005
BUG=360909
Review URL: https://codereview.chromium.org/235893017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/browser/extension_protocols.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc index bb61b25..32b6bc0 100644 --- a/extensions/browser/extension_protocols.cc +++ b/extensions/browser/extension_protocols.cc @@ -18,6 +18,7 @@ #include "base/message_loop/message_loop.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" +#include "base/metrics/sparse_histogram.h" #include "base/path_service.h" #include "base/sha1.h" #include "base/strings/string_number_conversions.h" @@ -219,7 +220,11 @@ class URLRequestExtensionJob : public net::URLRequestFileJob { } virtual void OnReadComplete(net::IOBuffer* buffer, int result) OVERRIDE { - UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.OnReadCompleteResult", result); + if (result >= 0) + UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.OnReadCompleteResult", result); + else + UMA_HISTOGRAM_SPARSE_SLOWLY("ExtensionUrlRequest.OnReadCompleteError", + -result); if (result > 0) { bytes_read_ += result; if (hash_.get()) { |