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

Side by Side Diff: metrics_daemon.h

Issue 6541007: Find device-dependent disk stats file, and skip disk stats if not available. (Closed) Base URL: http://git.chromium.org/git/metrics.git@master
Patch Set: More small changes Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | metrics_daemon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « Makefile ('k') | metrics_daemon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698