Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: webkit/browser/appcache/appcache_histograms.cc

Issue 165613002: Add UMA stats for AppCacheUpdateJob results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/browser/appcache/appcache_histograms.h ('k') | webkit/browser/appcache/appcache_update_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/appcache/appcache_histograms.cc
diff --git a/webkit/browser/appcache/appcache_histograms.cc b/webkit/browser/appcache/appcache_histograms.cc
index dd00eb9c382847bf4f62b1da5dd3ecd4c2a3940a..6b5299b7c4b9715ad8c29c7c30fb15f954eede18 100644
--- a/webkit/browser/appcache/appcache_histograms.cc
+++ b/webkit/browser/appcache/appcache_histograms.cc
@@ -8,6 +8,12 @@
namespace appcache {
+static std::string OriginToCustomHistogramSuffix(const GURL& origin_url) {
+ if (origin_url.host() == "docs.google.com")
+ return ".Docs";
+ return std::string();
+}
+
void AppCacheHistograms::CountInitResult(InitResultType init_result) {
UMA_HISTOGRAM_ENUMERATION(
"appcache.InitResult",
@@ -22,6 +28,24 @@ void AppCacheHistograms::CountCorruptionDetected() {
UMA_HISTOGRAM_BOOLEAN("appcache.CorruptionDetected", true);
}
+void AppCacheHistograms::CountUpdateJobResult(
+ AppCacheUpdateJob::ResultType result,
+ const GURL& origin_url) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "appcache.UpdateJobResult",
+ result, AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES);
+
+ const std::string suffix = OriginToCustomHistogramSuffix(origin_url);
michaeln 2014/02/15 00:03:56 This is copy/pasted from what idb does for open re
jsbell 2014/02/15 00:23:54 ... which we swiped from HostToCustomHistogramSuff
+ if (!suffix.empty()) {
+ base::LinearHistogram::FactoryGet(
+ "appcache.UpdateJobResult" + suffix,
+ 1,
+ AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES,
+ AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES + 1,
+ base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result);
+ }
+}
+
void AppCacheHistograms::CountCheckResponseResult(
CheckResponseResultType result) {
UMA_HISTOGRAM_ENUMERATION(
@@ -29,6 +53,7 @@ void AppCacheHistograms::CountCheckResponseResult(
result, NUM_CHECK_RESPONSE_RESULT_TYPES);
}
+
jsbell 2014/02/15 00:23:54 Delete extra blank line
void AppCacheHistograms::AddTaskQueueTimeSample(
const base::TimeDelta& duration) {
UMA_HISTOGRAM_TIMES("appcache.TaskQueueTime", duration);
« no previous file with comments | « webkit/browser/appcache/appcache_histograms.h ('k') | webkit/browser/appcache/appcache_update_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698