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

Unified Diff: components/ukm/metrics_reporting_scheduler.cc

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/ukm/metrics_reporting_scheduler.cc
diff --git a/components/ukm/metrics_reporting_scheduler.cc b/components/ukm/metrics_reporting_scheduler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cea69c84854f754cd4d304412c15db80906d016d
--- /dev/null
+++ b/components/ukm/metrics_reporting_scheduler.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium 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 "components/ukm/metrics_reporting_scheduler.h"
+
+#include "base/metrics/histogram_macros.h"
+
+namespace ukm {
+
+MetricsReportingScheduler::MetricsReportingScheduler(
+ const base::Closure& upload_callback,
+ const base::Callback<base::TimeDelta(void)>& upload_interval_callback)
+ : metrics::MetricsReportingScheduler(upload_callback,
+ upload_interval_callback) {}
+
+MetricsReportingScheduler::~MetricsReportingScheduler() = default;
+
+void MetricsReportingScheduler::LogMetricsInitSequence(InitSequence sequence) {
+ UMA_HISTOGRAM_ENUMERATION("UKM.InitSequence", sequence,
+ INIT_SEQUENCE_ENUM_SIZE);
+}
+
+void MetricsReportingScheduler::LogActualUploadInterval(
+ base::TimeDelta interval) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("UKM.ActualLogUploadInterval",
+ interval.InMinutes(), 1,
+ base::TimeDelta::FromHours(12).InMinutes(), 50);
+}
+
+} // namespace ukm

Powered by Google App Engine
This is Rietveld 408576698