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

Unified Diff: chromecast/browser/cast_memory_pressure_monitor.cc

Issue 2028233002: [Chromecast] Add free memory UMA histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_memory_pressure_monitor.cc
diff --git a/chromecast/browser/cast_memory_pressure_monitor.cc b/chromecast/browser/cast_memory_pressure_monitor.cc
index 7246dd8ef10037efa9695525e796f44ac6586e9e..5dd85898bfd74dec4c18c77989650e82d13fcce5 100644
--- a/chromecast/browser/cast_memory_pressure_monitor.cc
+++ b/chromecast/browser/cast_memory_pressure_monitor.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/location.h"
+#include "base/metrics/histogram_macros.h"
#include "base/process/process_metrics.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -88,6 +89,13 @@ void CastMemoryPressureMonitor::PollPressureLevel() {
}
UpdateMemoryPressureLevel(level);
+
+ UMA_HISTOGRAM_PERCENTAGE("Platform.MeminfoMemFree",
+ (info.free * 100.0) / info.total);
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Platform.MeminfoMemFreeDerived",
+ info.free + info.buffers + info.cached, 1,
+ info.total, 100);
wzhong 2016/06/01 20:24:25 The info.total varies by platform though, for exam
+
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&CastMemoryPressureMonitor::PollPressureLevel,
weak_ptr_factory_.GetWeakPtr()),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698