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

Unified Diff: content/child/child_discardable_shared_memory_manager.cc

Issue 984803002: content: Add histogram for discardable memory allocation size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_discardable_shared_memory_manager.cc
diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc
index c6990e4a8fcb3cfb3646725cea9222325f51e0a1..cf4e488dcba6f12cf21cf7f70a1b0a0f821a65e6 100644
--- a/content/child/child_discardable_shared_memory_manager.cc
+++ b/content/child/child_discardable_shared_memory_manager.cc
@@ -6,6 +6,7 @@
#include "base/debug/crash_logging.h"
#include "base/memory/discardable_shared_memory.h"
+#include "base/metrics/histogram.h"
#include "base/process/process_metrics.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
@@ -66,6 +67,12 @@ ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory(
DCHECK_NE(size, 0u);
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.DiscardableAllocationSize",
+ size / 1024, // In KB
+ 1,
+ 4 * 1024 * 1024, // 4 GB
+ 50);
+
// Round up to multiple of page size.
size_t pages = (size + base::GetPageSize() - 1) / base::GetPageSize();
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698