| 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 UKM metrics. | 5 // ReportingService specialized to report UKM metrics. |
| 6 | 6 |
| 7 #include "components/ukm/ukm_reporting_service.h" | 7 #include "components/ukm/ukm_reporting_service.h" |
| 8 | 8 |
| 9 #include "base/metrics/field_trial_params.h" | 9 #include "base/metrics/field_trial_params.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 metrics::MetricsLogUploader::MetricServiceType | 82 metrics::MetricsLogUploader::MetricServiceType |
| 83 UkmReportingService::service_type() const { | 83 UkmReportingService::service_type() const { |
| 84 return metrics::MetricsLogUploader::UKM; | 84 return metrics::MetricsLogUploader::UKM; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void UkmReportingService::LogCellularConstraint(bool upload_canceled) { | 87 void UkmReportingService::LogCellularConstraint(bool upload_canceled) { |
| 88 UMA_HISTOGRAM_BOOLEAN("UKM.LogUpload.Canceled.CellularConstraint", | 88 UMA_HISTOGRAM_BOOLEAN("UKM.LogUpload.Canceled.CellularConstraint", |
| 89 upload_canceled); | 89 upload_canceled); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void UkmReportingService::LogResponseCode(int response_code) { | 92 void UkmReportingService::LogResponseOrErrorCode(int response_code, |
| 93 UMA_HISTOGRAM_SPARSE_SLOWLY("UKM.Upload.ResponseCode", response_code); | 93 int error_code) { |
| 94 UMA_HISTOGRAM_SPARSE_SLOWLY("UKM.LogUpload.ResponseOrErrorCode", |
| 95 response_code >= 0 ? response_code : error_code); |
| 94 } | 96 } |
| 95 | 97 |
| 96 void UkmReportingService::LogSuccess(size_t log_size) { | 98 void UkmReportingService::LogSuccess(size_t log_size) { |
| 97 UMA_HISTOGRAM_COUNTS_10000("UKM.LogSize.OnSuccess", log_size / 1024); | 99 UMA_HISTOGRAM_COUNTS_10000("UKM.LogSize.OnSuccess", log_size / 1024); |
| 98 } | 100 } |
| 99 | 101 |
| 100 void UkmReportingService::LogLargeRejection(size_t log_size) {} | 102 void UkmReportingService::LogLargeRejection(size_t log_size) {} |
| 101 | 103 |
| 102 } // namespace metrics | 104 } // namespace metrics |
| OLD | NEW |