1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/browser/appcache/appcache_histograms.h"
6
7 #include "base/metrics/histogram.h"
8
9 namespace appcache {
10
CountInitResult(InitResultType init_result)11 void AppCacheHistograms::CountInitResult(InitResultType init_result) {
12 UMA_HISTOGRAM_ENUMERATION(
13 "appcache.InitResult",
14 init_result, NUM_INIT_RESULT_TYPES);
15 }
16
CountReinitAttempt(bool repeated_attempt)17 void AppCacheHistograms::CountReinitAttempt(bool repeated_attempt) {
18 UMA_HISTOGRAM_BOOLEAN("appcache.ReinitAttempt", repeated_attempt);
19 }
20
CountCheckResponseResult(CheckResponseResultType result)21 void AppCacheHistograms::CountCheckResponseResult(
22 CheckResponseResultType result) {
23 UMA_HISTOGRAM_ENUMERATION(
24 "appcache.CheckResponseResult",
25 result, NUM_CHECK_RESPONSE_RESULT_TYPES);
26 }
27
AddTaskQueueTimeSample(const base::TimeDelta & duration)28 void AppCacheHistograms::AddTaskQueueTimeSample(
29 const base::TimeDelta& duration) {
30 UMA_HISTOGRAM_TIMES("appcache.TaskQueueTime", duration);
31 }
32
AddTaskRunTimeSample(const base::TimeDelta & duration)33 void AppCacheHistograms::AddTaskRunTimeSample(
34 const base::TimeDelta& duration) {
35 UMA_HISTOGRAM_TIMES("appcache.TaskRunTime", duration);
36 }
37
AddCompletionQueueTimeSample(const base::TimeDelta & duration)38 void AppCacheHistograms::AddCompletionQueueTimeSample(
39 const base::TimeDelta& duration) {
40 UMA_HISTOGRAM_TIMES("appcache.CompletionQueueTime", duration);
41 }
42
AddCompletionRunTimeSample(const base::TimeDelta & duration)43 void AppCacheHistograms::AddCompletionRunTimeSample(
44 const base::TimeDelta& duration) {
45 UMA_HISTOGRAM_TIMES("appcache.CompletionRunTime", duration);
46 }
47
AddNetworkJobStartDelaySample(const base::TimeDelta & duration)48 void AppCacheHistograms::AddNetworkJobStartDelaySample(
49 const base::TimeDelta& duration) {
50 UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.Network", duration);
51 }
52
AddErrorJobStartDelaySample(const base::TimeDelta & duration)53 void AppCacheHistograms::AddErrorJobStartDelaySample(
54 const base::TimeDelta& duration) {
55 UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.Error", duration);
56 }
57
AddAppCacheJobStartDelaySample(const base::TimeDelta & duration)58 void AppCacheHistograms::AddAppCacheJobStartDelaySample(
59 const base::TimeDelta& duration) {
60 UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.AppCache", duration);
61 }
62
AddMissingManifestEntrySample()63 void AppCacheHistograms::AddMissingManifestEntrySample() {
64 UMA_HISTOGRAM_BOOLEAN("appcache.MissingManifestEntry", true);
65 }
66
AddMissingManifestDetectedAtCallsite(MissingManifestCallsiteType callsite)67 void AppCacheHistograms::AddMissingManifestDetectedAtCallsite(
68 MissingManifestCallsiteType callsite) {
69 UMA_HISTOGRAM_ENUMERATION(
70 "appcache.MissingManifestDetectedAtCallsite",
71 callsite, NUM_MISSING_MANIFEST_CALLSITE_TYPES);
72 }
73
74 } // namespace appcache
75