summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 22:14:47 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 22:14:47 +0000
commit4a65637a73afc2ae43c2b8a8880b36e513b765a0 (patch)
treeced29a9f23b367cf207256d2fb91ab29dfbf1532 /extensions
parentf76dc353b84dcdd78de944db874424c4f4b14b95 (diff)
downloadchromium_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.cc7
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()) {