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

Unified Diff: components/ukm/persisted_logs_metrics_impl.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/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..7534854c0717df043f13544a38a12f05d1700e36
--- /dev/null
+++ b/components/ukm/persisted_logs_metrics_impl.cc
@@ -0,0 +1,38 @@
+// 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/persisted_logs_metrics_impl.h"
+
+#include "base/metrics/histogram_macros.h"
+
+namespace ukm {
+
+PersistedLogsMetricsImpl::PersistedLogsMetricsImpl() = default;
+
+PersistedLogsMetricsImpl::~PersistedLogsMetricsImpl() = default;
+
+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_1M("UKM.UnsentLogs.DroppedSize", static_cast<int>(size));
+}
+
+void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) {
+ UMA_HISTOGRAM_COUNTS_10000("UKM.UnsentLogs.NumDropped", dropped_logs_num);
+}
+
+} // namespace ukm

Powered by Google App Engine
This is Rietveld 408576698