Chromium Code Reviews| Index: metrics_daemon.h |
| diff --git a/metrics_daemon.h b/metrics_daemon.h |
| index 5f2e7868a9aed95793ea023f1863f2503326ccde..7ba448e7d918408bd62ec1c215ee76f1ac599608 100644 |
| --- a/metrics_daemon.h |
| +++ b/metrics_daemon.h |
| @@ -77,6 +77,12 @@ class MetricsDaemon { |
| kNumberSessionStates |
| }; |
| + // State for disk stats collector callback. |
| + enum DiskStatsState { |
| + kDiskStatsShort, // short wait before short interval collection |
| + kDiskStatsLong, // final wait before new collection |
| + }; |
| + |
| // Data record for aggregating daily usage. |
| class UseRecord { |
| public: |
| @@ -111,6 +117,15 @@ class MetricsDaemon { |
| static const char kMetricUserCrashesDailyName[]; |
| static const char kMetricUserCrashesWeeklyName[]; |
| static const char kMetricUserCrashIntervalName[]; |
| + static const char kMetricReadSectorsLongName[]; |
| + static const char kMetricReadSectorsShortName[]; |
| + static const char kMetricWriteSectorsLongName[]; |
| + static const char kMetricWriteSectorsShortName[]; |
| + static const int kMetricDiskStatsShortInterval; |
| + static const int kMetricDiskStatsLongInterval; |
| + static const int kMetricSectorsIOMax; |
| + static const int kMetricSectorsBuckets; |
| + static const char kMetricsDiskStatsPath[]; |
| // D-Bus message match strings. |
| static const char* kDBusMatches_[]; |
| @@ -217,6 +232,22 @@ class MetricsDaemon { |
| void SendMetric(const std::string& name, int sample, |
| int min, int max, int nbuckets); |
| + // Initializes disk stats reporting. |
| + void DiskStatsReporterInit(); |
| + |
| + // Schedules a callback for the next disk stats collection. |
| + void ScheduleDiskStatsCallback(int wait); |
| + |
| + // Reads cumulative disk statistics from sysfs. |
| + void DiskStatsReadStats(long int* read_sectors, long int* write_sectors); |
| + |
| + // Reports disk statistics (static version for glib). Arguments are a glib |
| + // artifact. |
| + static gboolean DiskStatsCallbackStatic(void* handle); |
| + |
| + // Reports disk statistics. |
| + void DiskStatsCallback(); |
| + |
| // Test mode. |
| bool testing_; |
| @@ -265,6 +296,14 @@ class MetricsDaemon { |
| // Scheduled daily use monitor source (see ScheduleUseMonitor). |
| GSource* usemon_source_; |
| + |
| + // Contains the most recent disk stats. |
| + long int read_sectors_; |
| + long int write_sectors_; |
| + |
| + GSource* diskstats_source_; |
| + DiskStatsState diskstats_state_; |
| + |
|
petkov
2011/02/11 06:42:30
remove blank line
|
| }; |
| #endif // METRICS_DAEMON_H_ |