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

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, 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
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..2fd3d0ad9d1e36fb2437bc5af577d89f502fc2fb 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
+ 0,
Alexei Svitkine (slow) 2015/03/06 15:49:08 There is already a default overflow bucket between
reveman 2015/03/07 23:05:45 Done.
+ 4 * 1024 * 1024, // 4 GB
+ 256);
Alexei Svitkine (slow) 2015/03/06 15:49:08 Why do you need 256 buckets? This is much more tha
reveman 2015/03/07 23:05:45 Reduced it to 50 which is the same as UMA_HISTOGRA
reveman 2015/03/09 00:31:21 Just realized that the bucket layout is already ex
+
// 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698