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

Unified Diff: metrics_daemon.h

Issue 6804014: Add meminfo UMA collection. (Closed) Base URL: http://git.chromium.org/git/metrics.git@master
Patch Set: more fixes Created 9 years, 8 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 | metrics_daemon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: metrics_daemon.h
diff --git a/metrics_daemon.h b/metrics_daemon.h
index 52525182953fee9bb368a0c9776ce0fafd113136..e0614452bcc9b0258c86a89dd76bf3d72b707440 100644
--- a/metrics_daemon.h
+++ b/metrics_daemon.h
@@ -49,6 +49,8 @@ class MetricsDaemon {
FRIEND_TEST(MetricsDaemonTest, MessageFilter);
FRIEND_TEST(MetricsDaemonTest, PowerStateChanged);
FRIEND_TEST(MetricsDaemonTest, ProcessKernelCrash);
+ FRIEND_TEST(MetricsDaemonTest, ProcessMeminfo);
+ FRIEND_TEST(MetricsDaemonTest, ProcessMeminfo2);
FRIEND_TEST(MetricsDaemonTest, ProcessUncleanShutdown);
FRIEND_TEST(MetricsDaemonTest, ProcessUserCrash);
FRIEND_TEST(MetricsDaemonTest, ReportCrashesDailyFrequency);
@@ -125,6 +127,7 @@ class MetricsDaemon {
static const char kMetricWriteSectorsShortName[];
static const int kMetricDiskStatsShortInterval;
static const int kMetricDiskStatsLongInterval;
+ static const int kMetricMeminfoInterval;
static const int kMetricSectorsIOMax;
static const int kMetricSectorsBuckets;
static const char kMetricsDiskStatsPath[];
@@ -234,6 +237,12 @@ class MetricsDaemon {
void SendMetric(const std::string& name, int sample,
int min, int max, int nbuckets);
+ // Sends a linear histogram sample to Chrome for transport to UMA. See
+ // MetricsLibrary::SendToUMA in metrics_library.h for a description of the
+ // arguments.
+ void SendLinearMetric(const std::string& name, int sample,
+ int max, int nbuckets);
+
// Initializes disk stats reporting.
void DiskStatsReporterInit();
@@ -250,6 +259,20 @@ class MetricsDaemon {
// Reports disk statistics.
void DiskStatsCallback();
+ // Schedules meminfo collection callback.
+ void ScheduleMeminfoCallback(int wait);
+
+ // Reports memory statistics (static version for glib). Argument is a glib
+ // artifact.
+ static gboolean MeminfoCallbackStatic(void* handle);
+
+ // Reports memory statistics. Returns false on failure.
+ gboolean MeminfoCallback();
+
+ // Parses content of /proc/meminfo and sends fields of interest to UMA.
+ // Returns false on errors.
+ gboolean ProcessMeminfo(std::string meminfo);
+
// Test mode.
bool testing_;
« no previous file with comments | « no previous file | metrics_daemon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698