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

Unified Diff: components/ukm/persisted_logs_metrics_impl.cc

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Proto and client_id Created 4 years 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/persisted_logs_metrics_impl.cc
diff --git a/components/ukm/persisted_logs_metrics_impl.cc b/components/ukm/persisted_logs_metrics_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f507f553dfc4e3ab53b9e78b43d019e7d4fa3b7b
--- /dev/null
+++ b/components/ukm/persisted_logs_metrics_impl.cc
@@ -0,0 +1,35 @@
+// Copyright 2016 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/persisted_logs_metrics_impl.h"
+
+#include "base/metrics/histogram_macros.h"
+
+namespace ukm {
+
+metrics::PersistedLogs::LogReadStatus
+PersistedLogsMetricsImpl::RecordLogReadStatus(
+ metrics::PersistedLogs::LogReadStatus status) {
+ UMA_HISTOGRAM_ENUMERATION("UKM.PersistentLogRecall.Status",
+ status, metrics::PersistedLogs::END_RECALL_STATUS);
+ return status;
+}
+
+void PersistedLogsMetricsImpl::RecordCompressionRatio(
+ size_t compressed_size, size_t original_size) {
+ UMA_HISTOGRAM_PERCENTAGE(
+ "UKM.ProtoCompressionRatio",
+ static_cast<int>(100 * compressed_size / original_size));
+}
+
+void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) {
+ UMA_HISTOGRAM_COUNTS("UKM.UnsentLogs.Dropped.Size",
rkaplow 2017/01/02 23:23:03 nit, we should use _number for these macros. Looki
Steven Holte 2017/01/03 21:16:03 Done.
+ static_cast<int>(size));
+}
+
+void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) {
+ UMA_HISTOGRAM_COUNTS("UKM.UnsentLogs.Dropped", dropped_logs_num);
rkaplow 2017/01/02 23:23:03 Looking at the UMA ones, I'd suggest using 10000 i
Steven Holte 2017/01/03 21:16:03 Done.
+}
+
+} // namespace ukm

Powered by Google App Engine
This is Rietveld 408576698