OLD | NEW |
---|---|
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 // ReportingService specialized to report UMA metrics. | 5 // ReportingService specialized to report UMA metrics. |
6 | 6 |
7 #include "components/metrics/metrics_reporting_service.h" | 7 #include "components/metrics/metrics_reporting_service.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 upload_canceled); | 89 upload_canceled); |
90 } | 90 } |
91 | 91 |
92 void MetricsReportingService::LogResponseCode(int response_code) { | 92 void MetricsReportingService::LogResponseCode(int response_code) { |
93 // Log a histogram to track response success vs. failure rates. | 93 // Log a histogram to track response success vs. failure rates. |
94 UMA_HISTOGRAM_ENUMERATION("UMA.UploadResponseStatus.Protobuf", | 94 UMA_HISTOGRAM_ENUMERATION("UMA.UploadResponseStatus.Protobuf", |
95 ResponseCodeToStatus(response_code), | 95 ResponseCodeToStatus(response_code), |
96 NUM_RESPONSE_STATUSES); | 96 NUM_RESPONSE_STATUSES); |
97 } | 97 } |
98 | 98 |
99 void MetricsReportingService::LogErrorCode(int error_code) { | |
100 UMA_HISTOGRAM_SPARSE_SLOWLY("UMA.FailedUploadErrorCode", -error_code); | |
Alexei Svitkine (slow)
2017/03/23 15:23:42
I think error and response code should be logged i
Steven Holte
2017/03/23 20:38:07
Done.
| |
101 } | |
102 | |
99 void MetricsReportingService::LogSuccess(size_t log_size) { | 103 void MetricsReportingService::LogSuccess(size_t log_size) { |
100 UMA_HISTOGRAM_COUNTS_10000("UMA.LogSize.OnSuccess", log_size / 1024); | 104 UMA_HISTOGRAM_COUNTS_10000("UMA.LogSize.OnSuccess", log_size / 1024); |
101 } | 105 } |
102 | 106 |
103 void MetricsReportingService::LogLargeRejection(size_t log_size) { | 107 void MetricsReportingService::LogLargeRejection(size_t log_size) { |
104 UMA_HISTOGRAM_COUNTS_1M("UMA.Large Rejected Log was Discarded", | 108 UMA_HISTOGRAM_COUNTS_1M("UMA.Large Rejected Log was Discarded", |
105 static_cast<int>(log_size)); | 109 static_cast<int>(log_size)); |
106 } | 110 } |
107 | 111 |
108 } // namespace metrics | 112 } // namespace metrics |
OLD | NEW |