blob: fbb871ec1ddf72137659ed5d8199a22b527b749c [file] [log] [blame]
Bertrand SIMONNET52e5b992015-08-10 15:18:00 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Darin Petkov65b01462010-04-14 13:32:20 -070016
Luigi Semenzato4a6c9422014-06-30 18:12:28 -070017#ifndef METRICS_METRICS_DAEMON_H_
18#define METRICS_METRICS_DAEMON_H_
Darin Petkov65b01462010-04-14 13:32:20 -070019
Ben Chanf05ab402014-08-07 00:54:59 -070020#include <stdint.h>
21
Ken Mixter4c5daa42010-08-26 18:35:06 -070022#include <map>
Luigi Semenzato4a6c9422014-06-30 18:12:28 -070023#include <string>
24#include <vector>
Darin Petkov65b01462010-04-14 13:32:20 -070025
Ben Chan2e6543d2014-02-05 23:26:25 -080026#include <base/files/file_path.h>
Chris Masone817016a2011-05-12 14:14:48 -070027#include <base/memory/scoped_ptr.h>
Ben Chan2e6543d2014-02-05 23:26:25 -080028#include <base/time/time.h>
Steve Funge86591e2014-12-01 13:38:21 -080029#include <chromeos/daemons/dbus_daemon.h>
Darin Petkovf1e85e42010-06-10 15:59:53 -070030#include <gtest/gtest_prod.h> // for FRIEND_TEST
31
Luigi Semenzato4a6c9422014-06-30 18:12:28 -070032#include "metrics/metrics_library.h"
Bertrand SIMONNET4b915ae2015-07-28 15:38:14 -070033#include "persistent_integer.h"
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070034#include "uploader/upload_service.h"
Darin Petkovfc91b422010-05-12 13:05:45 -070035
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -080036using chromeos_metrics::PersistentInteger;
Darin Petkov2ccef012010-05-05 16:06:37 -070037
Steve Funge86591e2014-12-01 13:38:21 -080038class MetricsDaemon : public chromeos::DBusDaemon {
Darin Petkov65b01462010-04-14 13:32:20 -070039 public:
Darin Petkovf1e85e42010-06-10 15:59:53 -070040 MetricsDaemon();
41 ~MetricsDaemon();
Darin Petkov65b01462010-04-14 13:32:20 -070042
Steve Funge86591e2014-12-01 13:38:21 -080043 // Initializes metrics class variables.
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070044 void Init(bool testing,
45 bool uploader_active,
Bertrand SIMONNETfec4d2c2015-08-05 16:04:14 -070046 bool dbus_enabled,
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070047 MetricsLibraryInterface* metrics_lib,
Bertrand SIMONNETebbe35c2015-09-08 10:13:35 -070048 const std::string& diskstats_path,
Luigi Semenzatofb3a8212013-05-07 16:55:00 -070049 const std::string& cpuinfo_max_freq_path,
Steve Fung67906c62014-10-06 15:15:30 -070050 const std::string& scaling_max_freq_path,
Bertrand SIMONNETcac74e12014-10-09 10:14:13 -070051 const base::TimeDelta& upload_interval,
Steve Fung67906c62014-10-06 15:15:30 -070052 const std::string& server,
Bertrand SIMONNET2765d0a2015-09-09 10:38:20 -070053 const base::FilePath& metrics_directory);
Darin Petkov11b8eb32010-05-18 11:00:59 -070054
Steve Funge86591e2014-12-01 13:38:21 -080055 // Initializes DBus and MessageLoop variables before running the MessageLoop.
56 int OnInit() override;
57
58 // Clean up data set up in OnInit before shutting down message loop.
59 void OnShutdown(int* return_code) override;
60
61 // Does all the work.
62 int Run() override;
Darin Petkov65b01462010-04-14 13:32:20 -070063
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -070064 // Triggers an upload event and exit. (Used to test UploadService)
65 void RunUploaderTest();
66
Luigi Semenzato96360192014-06-04 10:53:35 -070067 protected:
68 // Used also by the unit tests.
69 static const char kComprDataSizeName[];
70 static const char kOrigDataSizeName[];
71 static const char kZeroPagesName[];
72
Darin Petkov65b01462010-04-14 13:32:20 -070073 private:
Darin Petkov2ccef012010-05-05 16:06:37 -070074 friend class MetricsDaemonTest;
Ken Mixterccd84c02010-08-16 19:57:13 -070075 FRIEND_TEST(MetricsDaemonTest, CheckSystemCrash);
Ken Mixter4c5daa42010-08-26 18:35:06 -070076 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoCurrent);
77 FRIEND_TEST(MetricsDaemonTest, ComputeEpochNoLast);
78 FRIEND_TEST(MetricsDaemonTest, GetHistogramPath);
79 FRIEND_TEST(MetricsDaemonTest, IsNewEpoch);
Darin Petkove579d662010-05-05 16:19:39 -070080 FRIEND_TEST(MetricsDaemonTest, MessageFilter);
Bertrand SIMONNETebbe35c2015-09-08 10:13:35 -070081 FRIEND_TEST(MetricsDaemonTest, ParseDiskStats);
Luigi Semenzato5bd764f2011-10-14 12:03:35 -070082 FRIEND_TEST(MetricsDaemonTest, ParseVmStats);
Darin Petkov38d5cb02010-06-24 12:10:26 -070083 FRIEND_TEST(MetricsDaemonTest, ProcessKernelCrash);
Luigi Semenzato29c7ef92011-04-12 14:12:35 -070084 FRIEND_TEST(MetricsDaemonTest, ProcessMeminfo);
85 FRIEND_TEST(MetricsDaemonTest, ProcessMeminfo2);
Ken Mixterccd84c02010-08-16 19:57:13 -070086 FRIEND_TEST(MetricsDaemonTest, ProcessUncleanShutdown);
Darin Petkov1bb904e2010-06-16 15:58:06 -070087 FRIEND_TEST(MetricsDaemonTest, ProcessUserCrash);
Ken Mixterccd84c02010-08-16 19:57:13 -070088 FRIEND_TEST(MetricsDaemonTest, ReportCrashesDailyFrequency);
Luigi Semenzatofb3a8212013-05-07 16:55:00 -070089 FRIEND_TEST(MetricsDaemonTest, ReadFreqToInt);
Ken Mixterccd84c02010-08-16 19:57:13 -070090 FRIEND_TEST(MetricsDaemonTest, ReportKernelCrashInterval);
91 FRIEND_TEST(MetricsDaemonTest, ReportUncleanShutdownInterval);
92 FRIEND_TEST(MetricsDaemonTest, ReportUserCrashInterval);
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -080093 FRIEND_TEST(MetricsDaemonTest, SendSample);
Luigi Semenzatofb3a8212013-05-07 16:55:00 -070094 FRIEND_TEST(MetricsDaemonTest, SendCpuThrottleMetrics);
Luigi Semenzato96360192014-06-04 10:53:35 -070095 FRIEND_TEST(MetricsDaemonTest, SendZramMetrics);
Darin Petkov41e06232010-05-03 16:45:37 -070096
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -080097 // State for disk stats collector callback.
Luigi Semenzato5bd764f2011-10-14 12:03:35 -070098 enum StatsState {
99 kStatsShort, // short wait before short interval collection
100 kStatsLong, // final wait before new collection
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800101 };
102
Luigi Semenzato3ccca062013-02-04 19:50:45 -0800103 // Type of scale to use for meminfo histograms. For most of them we use
104 // percent of total RAM, but for some we use absolute numbers, usually in
105 // megabytes, on a log scale from 0 to 4000, and 0 to 8000 for compressed
106 // swap (since it can be larger than total RAM).
Luigi Semenzato942cbab2013-02-12 13:17:07 -0800107 enum MeminfoOp {
108 kMeminfoOp_HistPercent = 0,
109 kMeminfoOp_HistLog,
110 kMeminfoOp_SwapTotal,
111 kMeminfoOp_SwapFree,
Luigi Semenzato3ccca062013-02-04 19:50:45 -0800112 };
113
Luigi Semenzato8accd332011-05-17 16:37:18 -0700114 // Record for retrieving and reporting values from /proc/meminfo.
115 struct MeminfoRecord {
Luigi Semenzato3ccca062013-02-04 19:50:45 -0800116 const char* name; // print name
117 const char* match; // string to match in output of /proc/meminfo
Luigi Semenzato942cbab2013-02-12 13:17:07 -0800118 MeminfoOp op; // histogram scale selector, or other operator
Luigi Semenzato3ccca062013-02-04 19:50:45 -0800119 int value; // value from /proc/meminfo
Luigi Semenzato8accd332011-05-17 16:37:18 -0700120 };
121
Sonny Rao4b8aebb2013-07-31 23:18:31 -0700122 // Record for retrieving and reporting values from /proc/vmstat
123 struct VmstatRecord {
124 uint64_t page_faults_; // major faults
125 uint64_t swap_in_; // pages swapped in
126 uint64_t swap_out_; // pages swapped out
127 };
128
Luigi Semenzato8accd332011-05-17 16:37:18 -0700129 // Returns the active time since boot (uptime minus sleep time) in seconds.
130 double GetActiveTime();
131
Darin Petkov703ec972010-04-27 11:02:18 -0700132 // D-Bus filter callback.
133 static DBusHandlerResult MessageFilter(DBusConnection* connection,
134 DBusMessage* message,
135 void* user_data);
Darin Petkov65b01462010-04-14 13:32:20 -0700136
Darin Petkov1bb904e2010-06-16 15:58:06 -0700137 // Updates the active use time and logs time between user-space
138 // process crashes.
139 void ProcessUserCrash();
140
Darin Petkov38d5cb02010-06-24 12:10:26 -0700141 // Updates the active use time and logs time between kernel crashes.
142 void ProcessKernelCrash();
143
Ken Mixterccd84c02010-08-16 19:57:13 -0700144 // Updates the active use time and logs time between unclean shutdowns.
145 void ProcessUncleanShutdown();
146
147 // Checks if a kernel crash has been detected and returns true if
148 // so. The method assumes that a kernel crash has happened if
149 // |crash_file| exists. It removes the file immediately if it
150 // exists, so it must not be called more than once.
151 bool CheckSystemCrash(const std::string& crash_file);
Darin Petkov38d5cb02010-06-24 12:10:26 -0700152
Darin Petkov11b8eb32010-05-18 11:00:59 -0700153 // Sends a regular (exponential) histogram sample to Chrome for
154 // transport to UMA. See MetricsLibrary::SendToUMA in
155 // metrics_library.h for a description of the arguments.
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800156 void SendSample(const std::string& name, int sample,
Darin Petkov11b8eb32010-05-18 11:00:59 -0700157 int min, int max, int nbuckets);
Darin Petkov65b01462010-04-14 13:32:20 -0700158
Luigi Semenzato29c7ef92011-04-12 14:12:35 -0700159 // Sends a linear histogram sample to Chrome for transport to UMA. See
160 // MetricsLibrary::SendToUMA in metrics_library.h for a description of the
161 // arguments.
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800162 void SendLinearSample(const std::string& name, int sample,
Luigi Semenzato29c7ef92011-04-12 14:12:35 -0700163 int max, int nbuckets);
164
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700165 // Sends various cumulative kernel crash-related stats, for instance the
166 // total number of kernel crashes since the last version update.
Luigi Semenzatoe5883fa2014-04-18 17:00:35 -0700167 void SendKernelCrashesCumulativeCountStats();
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700168
169 // Returns the total (system-wide) CPU usage between the time of the most
170 // recent call to this function and now.
171 base::TimeDelta GetIncrementalCpuUse();
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800172
Luigi Semenzatoe5883fa2014-04-18 17:00:35 -0700173 // Sends a sample representing the number of seconds of active use
Bertrand SIMONNET2d037832015-09-16 17:11:51 -0700174 // for a 24-hour period and reset |use|.
175 void SendAndResetDailyUseSample(
176 const scoped_ptr<PersistentInteger>& use);
Luigi Semenzatoe5883fa2014-04-18 17:00:35 -0700177
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800178 // Sends a sample representing a time interval between two crashes of the
Bertrand SIMONNET2d037832015-09-16 17:11:51 -0700179 // same type and reset |interval|.
180 void SendAndResetCrashIntervalSample(
181 const scoped_ptr<PersistentInteger>& interval);
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800182
Bertrand SIMONNET2d037832015-09-16 17:11:51 -0700183 // Sends a sample representing a frequency of crashes of some type and reset
184 // |frequency|.
185 void SendAndResetCrashFrequencySample(
186 const scoped_ptr<PersistentInteger>& frequency);
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800187
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700188 // Initializes vm and disk stats reporting.
189 void StatsReporterInit();
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800190
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700191 // Schedules a callback for the next vm and disk stats collection.
192 void ScheduleStatsCallback(int wait);
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800193
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700194 // Reads cumulative disk statistics from sysfs. Returns true for success.
Ben Chanf05ab402014-08-07 00:54:59 -0700195 bool DiskStatsReadStats(uint64_t* read_sectors, uint64_t* write_sectors);
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800196
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700197 // Reads cumulative vm statistics from procfs. Returns true for success.
Sonny Rao4b8aebb2013-07-31 23:18:31 -0700198 bool VmStatsReadStats(struct VmstatRecord* stats);
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800199
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700200 // Parse cumulative vm statistics from a C string. Returns true for success.
Sonny Rao4b8aebb2013-07-31 23:18:31 -0700201 bool VmStatsParseStats(const char* stats, struct VmstatRecord* record);
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700202
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700203 // Reports disk and vm statistics.
204 void StatsCallback();
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800205
Luigi Semenzato29c7ef92011-04-12 14:12:35 -0700206 // Schedules meminfo collection callback.
207 void ScheduleMeminfoCallback(int wait);
208
Steve Funge86591e2014-12-01 13:38:21 -0800209 // Reports memory statistics. Reschedules callback on success.
210 void MeminfoCallback(base::TimeDelta wait);
Luigi Semenzato29c7ef92011-04-12 14:12:35 -0700211
212 // Parses content of /proc/meminfo and sends fields of interest to UMA.
Luigi Semenzato8accd332011-05-17 16:37:18 -0700213 // Returns false on errors. |meminfo_raw| contains the content of
214 // /proc/meminfo.
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700215 bool ProcessMeminfo(const std::string& meminfo_raw);
Luigi Semenzato8accd332011-05-17 16:37:18 -0700216
217 // Parses meminfo data from |meminfo_raw|. |fields| is a vector containing
218 // the fields of interest. The order of the fields must be the same in which
219 // /proc/meminfo prints them. The result of parsing fields[i] is placed in
220 // fields[i].value.
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700221 bool FillMeminfo(const std::string& meminfo_raw,
222 std::vector<MeminfoRecord>* fields);
Luigi Semenzato8accd332011-05-17 16:37:18 -0700223
Luigi Semenzato0d9a9c92013-12-05 15:55:12 -0800224 // Schedule a memory use callback in |interval| seconds.
225 void ScheduleMemuseCallback(double interval);
Luigi Semenzato8accd332011-05-17 16:37:18 -0700226
Luigi Semenzato8accd332011-05-17 16:37:18 -0700227 // Calls MemuseCallbackWork, and possibly schedules next callback, if enough
228 // active time has passed. Otherwise reschedules itself to simulate active
229 // time callbacks (i.e. wall clock time minus sleep time).
230 void MemuseCallback();
231
232 // Reads /proc/meminfo and sends total anonymous memory usage to UMA.
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700233 bool MemuseCallbackWork();
Luigi Semenzato8accd332011-05-17 16:37:18 -0700234
Luigi Semenzatofb3a8212013-05-07 16:55:00 -0700235 // Parses meminfo data and sends it to UMA.
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700236 bool ProcessMemuse(const std::string& meminfo_raw);
Luigi Semenzato29c7ef92011-04-12 14:12:35 -0700237
Luigi Semenzatofb3a8212013-05-07 16:55:00 -0700238 // Sends stats for thermal CPU throttling.
239 void SendCpuThrottleMetrics();
240
241 // Reads an integer CPU frequency value from sysfs.
242 bool ReadFreqToInt(const std::string& sysfs_file_name, int* value);
243
Luigi Semenzato859b3f02014-02-05 15:33:19 -0800244 // Reads the current OS version from /etc/lsb-release and hashes it
245 // to a unsigned 32-bit int.
Ben Chanf05ab402014-08-07 00:54:59 -0700246 uint32_t GetOsVersionHash();
Luigi Semenzato859b3f02014-02-05 15:33:19 -0800247
Daniel Eratc83975a2014-04-04 08:53:44 -0700248 // Updates stats, additionally sending them to UMA if enough time has elapsed
249 // since the last report.
250 void UpdateStats(base::TimeTicks now_ticks, base::Time now_wall_time);
251
252 // Invoked periodically by |update_stats_timeout_id_| to call UpdateStats().
Steve Funge86591e2014-12-01 13:38:21 -0800253 void HandleUpdateStatsTimeout();
Daniel Eratc83975a2014-04-04 08:53:44 -0700254
Luigi Semenzato96360192014-06-04 10:53:35 -0700255 // Reports zram statistics.
256 bool ReportZram(const base::FilePath& zram_dir);
257
Ben Chanf05ab402014-08-07 00:54:59 -0700258 // Reads a string from a file and converts it to uint64_t.
259 static bool ReadFileToUint64(const base::FilePath& path, uint64_t* value);
Luigi Semenzato96360192014-06-04 10:53:35 -0700260
261 // VARIABLES
262
Darin Petkov2ccef012010-05-05 16:06:37 -0700263 // Test mode.
Darin Petkov41e06232010-05-03 16:45:37 -0700264 bool testing_;
Darin Petkov65b01462010-04-14 13:32:20 -0700265
Steve Funge86591e2014-12-01 13:38:21 -0800266 // Whether the uploader is enabled or disabled.
267 bool uploader_active_;
268
Bertrand SIMONNETfec4d2c2015-08-05 16:04:14 -0700269 // Whether or not dbus should be used.
270 // If disabled, we will not collect the frequency of crashes.
271 bool dbus_enabled_;
272
Bertrand SIMONNET71a62ef2014-10-07 11:26:25 -0700273 // Root of the configuration files to use.
Bertrand SIMONNET2765d0a2015-09-09 10:38:20 -0700274 base::FilePath metrics_directory_;
Bertrand SIMONNET71a62ef2014-10-07 11:26:25 -0700275
Darin Petkovfc91b422010-05-12 13:05:45 -0700276 // The metrics library handle.
277 MetricsLibraryInterface* metrics_lib_;
278
Daniel Eratc83975a2014-04-04 08:53:44 -0700279 // The last time that UpdateStats() was called.
280 base::TimeTicks last_update_stats_time_;
Darin Petkov41e06232010-05-03 16:45:37 -0700281
Luigi Semenzato0d9a9c92013-12-05 15:55:12 -0800282 // End time of current memuse stat collection interval.
283 double memuse_final_time_;
Luigi Semenzato8accd332011-05-17 16:37:18 -0700284
285 // Selects the wait time for the next memory use callback.
286 unsigned int memuse_interval_index_;
287
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700288 // Contain the most recent disk and vm cumulative stats.
Ben Chanf05ab402014-08-07 00:54:59 -0700289 uint64_t read_sectors_;
290 uint64_t write_sectors_;
Sonny Rao4b8aebb2013-07-31 23:18:31 -0700291 struct VmstatRecord vmstats_;
Luigi Semenzatoc88e42d2011-02-17 10:21:16 -0800292
Luigi Semenzato5bd764f2011-10-14 12:03:35 -0700293 StatsState stats_state_;
294 double stats_initial_time_;
295
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700296 // The system "HZ", or frequency of ticks. Some system data uses ticks as a
297 // unit, and this is used to convert to standard time units.
Ben Chanf05ab402014-08-07 00:54:59 -0700298 uint32_t ticks_per_second_;
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700299 // Used internally by GetIncrementalCpuUse() to return the CPU utilization
300 // between calls.
Ben Chanf05ab402014-08-07 00:54:59 -0700301 uint64_t latest_cpu_use_ticks_;
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700302
303 // Persistent values and accumulators for crash statistics.
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800304 scoped_ptr<PersistentInteger> daily_cycle_;
305 scoped_ptr<PersistentInteger> weekly_cycle_;
306 scoped_ptr<PersistentInteger> version_cycle_;
307
Luigi Semenzatoe5883fa2014-04-18 17:00:35 -0700308 // Active use accumulated in a day.
309 scoped_ptr<PersistentInteger> daily_active_use_;
310 // Active use accumulated since the latest version update.
311 scoped_ptr<PersistentInteger> version_cumulative_active_use_;
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800312
Luigi Semenzatoba0c65d2014-03-17 12:28:38 -0700313 // The CPU time accumulator. This contains the CPU time, in milliseconds,
314 // used by the system since the most recent OS version update.
315 scoped_ptr<PersistentInteger> version_cumulative_cpu_use_;
316
Luigi Semenzato2fd51cc2014-02-26 11:53:16 -0800317 scoped_ptr<PersistentInteger> user_crash_interval_;
318 scoped_ptr<PersistentInteger> kernel_crash_interval_;
319 scoped_ptr<PersistentInteger> unclean_shutdown_interval_;
320
321 scoped_ptr<PersistentInteger> any_crashes_daily_count_;
322 scoped_ptr<PersistentInteger> any_crashes_weekly_count_;
323 scoped_ptr<PersistentInteger> user_crashes_daily_count_;
324 scoped_ptr<PersistentInteger> user_crashes_weekly_count_;
325 scoped_ptr<PersistentInteger> kernel_crashes_daily_count_;
326 scoped_ptr<PersistentInteger> kernel_crashes_weekly_count_;
327 scoped_ptr<PersistentInteger> kernel_crashes_version_count_;
328 scoped_ptr<PersistentInteger> unclean_shutdowns_daily_count_;
329 scoped_ptr<PersistentInteger> unclean_shutdowns_weekly_count_;
330
Bertrand SIMONNETebbe35c2015-09-08 10:13:35 -0700331 std::string diskstats_path_;
Luigi Semenzatofb3a8212013-05-07 16:55:00 -0700332 std::string scaling_max_freq_path_;
333 std::string cpuinfo_max_freq_path_;
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700334
Bertrand SIMONNETcac74e12014-10-09 10:14:13 -0700335 base::TimeDelta upload_interval_;
Steve Fung67906c62014-10-06 15:15:30 -0700336 std::string server_;
Steve Fung67906c62014-10-06 15:15:30 -0700337
Bertrand SIMONNET46b49da2014-06-25 14:38:07 -0700338 scoped_ptr<UploadService> upload_service_;
Darin Petkov65b01462010-04-14 13:32:20 -0700339};
340
Luigi Semenzato4a6c9422014-06-30 18:12:28 -0700341#endif // METRICS_METRICS_DAEMON_H_