metrics: replace "Logging.*" with "Platform.*"
"Logging.*" is not a good name. Also remove unused function ReportDailyUse(). BUG=chromium:508535 TEST=it compiles Change-Id: I070bada4857abd80989ecc746adcbf1dcf6239a3 Reviewed-on: https://chromium-review.googlesource.com/284610 Tested-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
This commit is contained in:
parent
1eea1618cd
commit
dc86589885
4 changed files with 16 additions and 44 deletions
|
@ -52,7 +52,7 @@ Histogram Naming Convention
|
|||
|
||||
Use TrackerArea.MetricName. For example:
|
||||
|
||||
Logging.CrashCounter
|
||||
Platform.DailyUseTime
|
||||
Network.TimeToDrop
|
||||
|
||||
|
||||
|
|
|
@ -243,37 +243,37 @@ void MetricsDaemon::Init(bool testing,
|
|||
ticks_per_second_ = sysconf(_SC_CLK_TCK);
|
||||
|
||||
daily_active_use_.reset(
|
||||
new PersistentInteger("Logging.DailyUseTime"));
|
||||
new PersistentInteger("Platform.DailyUseTime"));
|
||||
version_cumulative_active_use_.reset(
|
||||
new PersistentInteger("Logging.CumulativeDailyUseTime"));
|
||||
new PersistentInteger("Platform.CumulativeDailyUseTime"));
|
||||
version_cumulative_cpu_use_.reset(
|
||||
new PersistentInteger("Logging.CumulativeCpuTime"));
|
||||
new PersistentInteger("Platform.CumulativeCpuTime"));
|
||||
|
||||
kernel_crash_interval_.reset(
|
||||
new PersistentInteger("Logging.KernelCrashInterval"));
|
||||
new PersistentInteger("Platform.KernelCrashInterval"));
|
||||
unclean_shutdown_interval_.reset(
|
||||
new PersistentInteger("Logging.UncleanShutdownInterval"));
|
||||
new PersistentInteger("Platform.UncleanShutdownInterval"));
|
||||
user_crash_interval_.reset(
|
||||
new PersistentInteger("Logging.UserCrashInterval"));
|
||||
new PersistentInteger("Platform.UserCrashInterval"));
|
||||
|
||||
any_crashes_daily_count_.reset(
|
||||
new PersistentInteger("Logging.AnyCrashesDaily"));
|
||||
new PersistentInteger("Platform.AnyCrashesDaily"));
|
||||
any_crashes_weekly_count_.reset(
|
||||
new PersistentInteger("Logging.AnyCrashesWeekly"));
|
||||
new PersistentInteger("Platform.AnyCrashesWeekly"));
|
||||
user_crashes_daily_count_.reset(
|
||||
new PersistentInteger("Logging.UserCrashesDaily"));
|
||||
new PersistentInteger("Platform.UserCrashesDaily"));
|
||||
user_crashes_weekly_count_.reset(
|
||||
new PersistentInteger("Logging.UserCrashesWeekly"));
|
||||
new PersistentInteger("Platform.UserCrashesWeekly"));
|
||||
kernel_crashes_daily_count_.reset(
|
||||
new PersistentInteger("Logging.KernelCrashesDaily"));
|
||||
new PersistentInteger("Platform.KernelCrashesDaily"));
|
||||
kernel_crashes_weekly_count_.reset(
|
||||
new PersistentInteger("Logging.KernelCrashesWeekly"));
|
||||
new PersistentInteger("Platform.KernelCrashesWeekly"));
|
||||
kernel_crashes_version_count_.reset(
|
||||
new PersistentInteger("Logging.KernelCrashesSinceUpdate"));
|
||||
new PersistentInteger("Platform.KernelCrashesSinceUpdate"));
|
||||
unclean_shutdowns_daily_count_.reset(
|
||||
new PersistentInteger("Logging.UncleanShutdownsDaily"));
|
||||
new PersistentInteger("Platform.UncleanShutdownsDaily"));
|
||||
unclean_shutdowns_weekly_count_.reset(
|
||||
new PersistentInteger("Logging.UncleanShutdownsWeekly"));
|
||||
new PersistentInteger("Platform.UncleanShutdownsWeekly"));
|
||||
|
||||
daily_cycle_.reset(new PersistentInteger("daily.cycle"));
|
||||
weekly_cycle_.reset(new PersistentInteger("weekly.cycle"));
|
||||
|
@ -1039,18 +1039,6 @@ bool MetricsDaemon::ProcessMemuse(const string& meminfo_raw) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void MetricsDaemon::ReportDailyUse(int use_seconds) {
|
||||
if (use_seconds <= 0)
|
||||
return;
|
||||
|
||||
int minutes = (use_seconds + kSecondsPerMinute / 2) / kSecondsPerMinute;
|
||||
SendSample("Logging.DailyUseTime",
|
||||
minutes,
|
||||
1,
|
||||
kMinutesPerDay * 30 * 2, // cumulative---two months worth
|
||||
50);
|
||||
}
|
||||
|
||||
void MetricsDaemon::SendSample(const string& name, int sample,
|
||||
int min, int max, int nbuckets) {
|
||||
metrics_lib_->SendToUMA(name, sample, min, max, nbuckets);
|
||||
|
|
|
@ -75,7 +75,6 @@ class MetricsDaemon : public chromeos::DBusDaemon {
|
|||
FRIEND_TEST(MetricsDaemonTest, ProcessUserCrash);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReportCrashesDailyFrequency);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReadFreqToInt);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReportDailyUse);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReportDiskStats);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReportKernelCrashInterval);
|
||||
FRIEND_TEST(MetricsDaemonTest, ReportUncleanShutdownInterval);
|
||||
|
@ -179,9 +178,6 @@ class MetricsDaemon : public chromeos::DBusDaemon {
|
|||
// exists, so it must not be called more than once.
|
||||
bool CheckSystemCrash(const std::string& crash_file);
|
||||
|
||||
// Report daily use through UMA.
|
||||
void ReportDailyUse(int use_seconds);
|
||||
|
||||
// Sends a regular (exponential) histogram sample to Chrome for
|
||||
// transport to UMA. See MetricsLibrary::SendToUMA in
|
||||
// metrics_library.h for a description of the arguments.
|
||||
|
|
|
@ -212,18 +212,6 @@ TEST_F(MetricsDaemonTest, CheckSystemCrash) {
|
|||
base::DeleteFile(crash_detected, false);
|
||||
}
|
||||
|
||||
TEST_F(MetricsDaemonTest, ReportDailyUse) {
|
||||
ExpectSample("Logging.DailyUseTime", 2);
|
||||
daemon_.ReportDailyUse(90);
|
||||
|
||||
ExpectSample("Logging.DailyUseTime", 1);
|
||||
daemon_.ReportDailyUse(89);
|
||||
|
||||
// There should be no metrics generated for the calls below.
|
||||
daemon_.ReportDailyUse(0);
|
||||
daemon_.ReportDailyUse(-5);
|
||||
}
|
||||
|
||||
TEST_F(MetricsDaemonTest, MessageFilter) {
|
||||
// Ignore calls to SendToUMA.
|
||||
EXPECT_CALL(metrics_lib_, SendToUMA(_, _, _, _, _)).Times(AnyNumber());
|
||||
|
|
Loading…
Reference in a new issue