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

Unified Diff: content/browser/cache_storage/cache_storage_histogram_macros.h

Issue 2168123002: [CacheStorage] Add metrics to the scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit Created 4 years, 5 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
Index: content/browser/cache_storage/cache_storage_histogram_macros.h
diff --git a/content/browser/cache_storage/cache_storage_histogram_macros.h b/content/browser/cache_storage/cache_storage_histogram_macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..92b0d87e03bdc5b0a7d3857b85c975f4b2350c92
--- /dev/null
+++ b/content/browser/cache_storage/cache_storage_histogram_macros.h
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_
+#define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_
+
+#include "base/metrics/histogram_macros.h"
+#include "content/browser/cache_storage/cache_storage_scheduler_client.h"
+
+namespace content {
+
+// Metrics to make it easier to write histograms for several clients.
+#define CACHE_STORAGE_SCHEDULER_UMA_THUNK(uma_type, args) \
+ UMA_HISTOGRAM_##uma_type args
+#define CACHE_STORAGE_SCHEDULER_UMA(uma_type, uma_name, client_type, ...) \
+ do { \
+ switch (client_type) { \
+ case CacheStorageSchedulerClient::CLIENT_STORAGE: \
+ CACHE_STORAGE_SCHEDULER_UMA_THUNK( \
+ uma_type, ("ServiceWorkerCache.CacheStorage.Scheduler." uma_name, \
+ ##__VA_ARGS__)); \
+ break; \
+ case CacheStorageSchedulerClient::CLIENT_CACHE: \
+ CACHE_STORAGE_SCHEDULER_UMA_THUNK( \
+ uma_type, \
+ ("ServiceWorkerCache.Cache.Scheduler." uma_name, ##__VA_ARGS__)); \
+ break; \
+ case CacheStorageSchedulerClient::CLIENT_BACKGROUND_SYNC: \
+ CACHE_STORAGE_SCHEDULER_UMA_THUNK( \
+ uma_type, \
+ ("ServiceWorkerCache.BackgroundSyncManager.Scheduler." uma_name, \
+ ##__VA_ARGS__)); \
+ break; \
+ default: \
+ NOTREACHED(); \
+ break; \
+ } \
+ } while (0)
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_HISTOGRAM_MACROS_H_
« no previous file with comments | « content/browser/cache_storage/cache_storage_cache.cc ('k') | content/browser/cache_storage/cache_storage_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698