| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/service_worker/service_worker_metrics.h" | 5 #include "content/browser/service_worker/service_worker_metrics.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/metrics/sparse_histogram.h" |
| 8 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 11 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
| 12 #include "content/public/browser/user_metrics.h" | 13 #include "content/public/browser/user_metrics.h" |
| 13 #include "content/public/common/content_client.h" | 14 #include "content/public/common/content_client.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.WriteResult", | 77 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.WriteResult", |
| 77 status, ServiceWorkerDatabase::STATUS_ERROR_MAX); | 78 status, ServiceWorkerDatabase::STATUS_ERROR_MAX); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void ServiceWorkerMetrics::RecordDestroyDatabaseResult( | 81 void ServiceWorkerMetrics::RecordDestroyDatabaseResult( |
| 81 ServiceWorkerDatabase::Status status) { | 82 ServiceWorkerDatabase::Status status) { |
| 82 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.DestroyDatabaseResult", | 83 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.DestroyDatabaseResult", |
| 83 status, ServiceWorkerDatabase::STATUS_ERROR_MAX); | 84 status, ServiceWorkerDatabase::STATUS_ERROR_MAX); |
| 84 } | 85 } |
| 85 | 86 |
| 87 void ServiceWorkerMetrics::RecordPurgeResourceResult(int net_error) { |
| 88 UMA_HISTOGRAM_SPARSE_SLOWLY("ServiceWorker.Storage.PurgeResourceResult", |
| 89 std::abs(net_error)); |
| 90 } |
| 91 |
| 86 void ServiceWorkerMetrics::RecordDiskCacheMigrationResult( | 92 void ServiceWorkerMetrics::RecordDiskCacheMigrationResult( |
| 87 DiskCacheMigrationResult result) { | 93 DiskCacheMigrationResult result) { |
| 88 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Storage.DiskCacheMigrationResult", | 94 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Storage.DiskCacheMigrationResult", |
| 89 result, NUM_MIGRATION_RESULT_TYPES); | 95 result, NUM_MIGRATION_RESULT_TYPES); |
| 90 } | 96 } |
| 91 | 97 |
| 92 void ServiceWorkerMetrics::RecordDeleteAndStartOverResult( | 98 void ServiceWorkerMetrics::RecordDeleteAndStartOverResult( |
| 93 DeleteAndStartOverResult result) { | 99 DeleteAndStartOverResult result) { |
| 94 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Storage.DeleteAndStartOverResult", | 100 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Storage.DeleteAndStartOverResult", |
| 95 result, NUM_DELETE_AND_START_OVER_RESULT_TYPES); | 101 result, NUM_DELETE_AND_START_OVER_RESULT_TYPES); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 "ServiceWorker.URLRequestJob.MainResource.StatusZeroError", error, | 214 "ServiceWorker.URLRequestJob.MainResource.StatusZeroError", error, |
| 209 blink::WebServiceWorkerResponseErrorLast + 1); | 215 blink::WebServiceWorkerResponseErrorLast + 1); |
| 210 } else { | 216 } else { |
| 211 UMA_HISTOGRAM_ENUMERATION( | 217 UMA_HISTOGRAM_ENUMERATION( |
| 212 "ServiceWorker.URLRequestJob.Subresource.StatusZeroError", error, | 218 "ServiceWorker.URLRequestJob.Subresource.StatusZeroError", error, |
| 213 blink::WebServiceWorkerResponseErrorLast + 1); | 219 blink::WebServiceWorkerResponseErrorLast + 1); |
| 214 } | 220 } |
| 215 } | 221 } |
| 216 | 222 |
| 217 } // namespace content | 223 } // namespace content |
| OLD | NEW |