| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef METRICS_DAEMON_H_ | 5 #ifndef METRICS_DAEMON_H_ |
| 6 #define METRICS_DAEMON_H_ | 6 #define METRICS_DAEMON_H_ |
| 7 | 7 |
| 8 #include <dbus/dbus.h> | 8 #include <dbus/dbus.h> |
| 9 #include <glib.h> | 9 #include <glib.h> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 class MetricsDaemon { | 25 class MetricsDaemon { |
| 26 | 26 |
| 27 public: | 27 public: |
| 28 MetricsDaemon(); | 28 MetricsDaemon(); |
| 29 ~MetricsDaemon(); | 29 ~MetricsDaemon(); |
| 30 | 30 |
| 31 // Initializes. | 31 // Initializes. |
| 32 void Init(bool testing, MetricsLibraryInterface* metrics_lib, | 32 void Init(bool testing, MetricsLibraryInterface* metrics_lib, |
| 33 const char* diskstats_path); | 33 std::string diskstats_path); |
| 34 | 34 |
| 35 // Does all the work. If |run_as_daemon| is true, daemonizes by | 35 // Does all the work. If |run_as_daemon| is true, daemonizes by |
| 36 // forking. | 36 // forking. |
| 37 void Run(bool run_as_daemon); | 37 void Run(bool run_as_daemon); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 friend class MetricsDaemonTest; | 40 friend class MetricsDaemonTest; |
| 41 FRIEND_TEST(MetricsDaemonTest, CheckSystemCrash); | 41 FRIEND_TEST(MetricsDaemonTest, CheckSystemCrash); |
| 42 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoCurrent); | 42 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoCurrent); |
| 43 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoLast); | 43 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoLast); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 int usemon_interval_; | 297 int usemon_interval_; |
| 298 | 298 |
| 299 // Scheduled daily use monitor source (see ScheduleUseMonitor). | 299 // Scheduled daily use monitor source (see ScheduleUseMonitor). |
| 300 GSource* usemon_source_; | 300 GSource* usemon_source_; |
| 301 | 301 |
| 302 // Contains the most recent disk stats. | 302 // Contains the most recent disk stats. |
| 303 long int read_sectors_; | 303 long int read_sectors_; |
| 304 long int write_sectors_; | 304 long int write_sectors_; |
| 305 | 305 |
| 306 DiskStatsState diskstats_state_; | 306 DiskStatsState diskstats_state_; |
| 307 const char* diskstats_path_; | 307 std::string diskstats_path_; |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 #endif // METRICS_DAEMON_H_ | 310 #endif // METRICS_DAEMON_H_ |
| OLD | NEW |