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

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

Issue 2689323010: Split a MetricsLogStore object out of MetricsLogManager. (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « components/ukm/persisted_logs_metrics_impl.h ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ukm/persisted_logs_metrics_impl.h" 5 #include "components/ukm/persisted_logs_metrics_impl.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 8
9 namespace ukm { 9 namespace ukm {
10 10
11 PersistedLogsMetricsImpl::PersistedLogsMetricsImpl() = default; 11 PersistedLogsMetricsImpl::PersistedLogsMetricsImpl() = default;
12 12
13 PersistedLogsMetricsImpl::~PersistedLogsMetricsImpl() = default; 13 PersistedLogsMetricsImpl::~PersistedLogsMetricsImpl() = default;
14 14
15 metrics::PersistedLogs::LogReadStatus 15 void PersistedLogsMetricsImpl::RecordLogReadStatus(
16 PersistedLogsMetricsImpl::RecordLogReadStatus( 16 metrics::PersistedLogsMetrics::LogReadStatus status) {
17 metrics::PersistedLogs::LogReadStatus status) {
18 UMA_HISTOGRAM_ENUMERATION("UKM.PersistentLogRecall.Status", status, 17 UMA_HISTOGRAM_ENUMERATION("UKM.PersistentLogRecall.Status", status,
19 metrics::PersistedLogs::END_RECALL_STATUS); 18 metrics::PersistedLogsMetrics::END_RECALL_STATUS);
20 return status;
21 } 19 }
22 20
23 void PersistedLogsMetricsImpl::RecordCompressionRatio(size_t compressed_size, 21 void PersistedLogsMetricsImpl::RecordCompressionRatio(size_t compressed_size,
24 size_t original_size) { 22 size_t original_size) {
25 UMA_HISTOGRAM_PERCENTAGE( 23 UMA_HISTOGRAM_PERCENTAGE(
26 "UKM.ProtoCompressionRatio", 24 "UKM.ProtoCompressionRatio",
27 static_cast<int>(100 * compressed_size / original_size)); 25 static_cast<int>(100 * compressed_size / original_size));
28 } 26 }
29 27
30 void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) { 28 void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) {
31 UMA_HISTOGRAM_COUNTS_1M("UKM.UnsentLogs.DroppedSize", static_cast<int>(size)); 29 UMA_HISTOGRAM_COUNTS_1M("UKM.UnsentLogs.DroppedSize", static_cast<int>(size));
32 } 30 }
33 31
34 void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) { 32 void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) {
35 UMA_HISTOGRAM_COUNTS_10000("UKM.UnsentLogs.NumDropped", dropped_logs_num); 33 UMA_HISTOGRAM_COUNTS_10000("UKM.UnsentLogs.NumDropped", dropped_logs_num);
36 } 34 }
37 35
38 } // namespace ukm 36 } // namespace ukm
OLDNEW
« no previous file with comments | « components/ukm/persisted_logs_metrics_impl.h ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698