| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/metrics/persisted_logs_metrics_impl.h" | 5 #include "components/metrics/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 metrics { | 9 namespace metrics { |
| 10 | 10 |
| 11 PersistedLogs::LogReadStatus | 11 void PersistedLogsMetricsImpl::RecordLogReadStatus( |
| 12 PersistedLogsMetricsImpl::RecordLogReadStatus( | 12 PersistedLogsMetrics::LogReadStatus status) { |
| 13 PersistedLogs::LogReadStatus status) { | 13 UMA_HISTOGRAM_ENUMERATION("PrefService.PersistentLogRecallProtobufs", status, |
| 14 UMA_HISTOGRAM_ENUMERATION("PrefService.PersistentLogRecallProtobufs", | 14 PersistedLogsMetrics::END_RECALL_STATUS); |
| 15 status, PersistedLogs::END_RECALL_STATUS); | |
| 16 return status; | |
| 17 } | 15 } |
| 18 | 16 |
| 19 void PersistedLogsMetricsImpl::RecordCompressionRatio( | 17 void PersistedLogsMetricsImpl::RecordCompressionRatio( |
| 20 size_t compressed_size, size_t original_size) { | 18 size_t compressed_size, size_t original_size) { |
| 21 UMA_HISTOGRAM_PERCENTAGE( | 19 UMA_HISTOGRAM_PERCENTAGE( |
| 22 "UMA.ProtoCompressionRatio", | 20 "UMA.ProtoCompressionRatio", |
| 23 static_cast<int>(100 * compressed_size / original_size)); | 21 static_cast<int>(100 * compressed_size / original_size)); |
| 24 } | 22 } |
| 25 | 23 |
| 26 void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) { | 24 void PersistedLogsMetricsImpl::RecordDroppedLogSize(size_t size) { |
| 27 UMA_HISTOGRAM_COUNTS("UMA.Large Accumulated Log Not Persisted", | 25 UMA_HISTOGRAM_COUNTS("UMA.Large Accumulated Log Not Persisted", |
| 28 static_cast<int>(size)); | 26 static_cast<int>(size)); |
| 29 } | 27 } |
| 30 | 28 |
| 31 void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) { | 29 void PersistedLogsMetricsImpl::RecordDroppedLogsNum(int dropped_logs_num) { |
| 32 UMA_HISTOGRAM_COUNTS("UMA.UnsentLogs.Dropped", dropped_logs_num); | 30 UMA_HISTOGRAM_COUNTS("UMA.UnsentLogs.Dropped", dropped_logs_num); |
| 33 } | 31 } |
| 34 | 32 |
| 35 } // namespace metrics | 33 } // namespace metrics |
| OLD | NEW |