2010-04-14 20:32:20 +00:00
|
|
|
// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
#include <gflags/gflags.h>
|
|
|
|
|
|
|
|
#include "metrics_daemon.h"
|
|
|
|
|
|
|
|
DEFINE_bool(daemon, true, "run as daemon (use -nodaemon for debugging)");
|
|
|
|
|
2011-02-17 18:21:16 +00:00
|
|
|
// Path to disk stats. This may be system dependent.
|
|
|
|
const char kMetricsMainDiskStatsPath[] = "/sys/class/block/sda/stat";
|
|
|
|
|
2010-04-14 20:32:20 +00:00
|
|
|
int main(int argc, char** argv) {
|
|
|
|
google::ParseCommandLineFlags(&argc, &argv, true);
|
2010-05-18 18:00:59 +00:00
|
|
|
MetricsLibrary metrics_lib;
|
|
|
|
metrics_lib.Init();
|
|
|
|
MetricsDaemon daemon;
|
2011-02-17 18:21:16 +00:00
|
|
|
daemon.Init(false, &metrics_lib, kMetricsMainDiskStatsPath);
|
2010-05-18 18:00:59 +00:00
|
|
|
daemon.Run(FLAGS_daemon);
|
2010-04-14 20:32:20 +00:00
|
|
|
}
|