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

Side by Side Diff: components/ukm/persisted_logs_metrics_impl.cc

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Check OFFICIAL_BUILD 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/ukm/persisted_logs_metrics_impl.h"
6
7 #include "base/metrics/histogram_macros.h"
8
9 namespace ukm {
10
11 PersistedLogsMetricsImpl::PersistedLogsMetricsImpl() = default;
12
13 PersistedLogsMetricsImpl::~PersistedLogsMetricsImpl() = default;
14
15 metrics::PersistedLogs::LogReadStatus
16 PersistedLogsMetricsImpl::RecordLogReadStatus(
17 metrics::PersistedLogs::LogReadStatus status) {
18 UMA_HISTOGRAM_ENUMERATION("UKM.PersistentLogRecall.Status", status,
19 metrics::PersistedLogs::END_RECALL_STATUS);
20 return status;
21 }
22
23 void PersistedLogsMetricsImpl::RecordCompressionRatio(size_t compressed_size,
24 size_t original_size) {
25 UMA_HISTOGRAM_PERCENTAGE(
26 "UKM.ProtoCompressionRatio",
27 static_cast<int>(100 * compressed_size / original_size));
28 }
29
30 void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) {
31 UMA_HISTOGRAM_COUNTS_1M("UKM.UnsentLogs.DroppedSize", static_cast<int>(size));
32 }
33
34 void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) {
35 UMA_HISTOGRAM_COUNTS_10000("UKM.UnsentLogs.NumDropped", dropped_logs_num);
36 }
37
38 } // namespace ukm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698