OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "webkit/browser/appcache/appcache_histograms.h" | 5 #include "webkit/browser/appcache/appcache_histograms.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 | 8 |
9 namespace appcache { | 9 namespace appcache { |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 void AppCacheHistograms::CountCheckResponseResult( | 49 void AppCacheHistograms::CountCheckResponseResult( |
50 CheckResponseResultType result) { | 50 CheckResponseResultType result) { |
51 UMA_HISTOGRAM_ENUMERATION( | 51 UMA_HISTOGRAM_ENUMERATION( |
52 "appcache.CheckResponseResult", | 52 "appcache.CheckResponseResult", |
53 result, NUM_CHECK_RESPONSE_RESULT_TYPES); | 53 result, NUM_CHECK_RESPONSE_RESULT_TYPES); |
54 } | 54 } |
55 | 55 |
56 void AppCacheHistograms::CountResponseRetrieval( | |
57 bool success, bool is_main_resource, const GURL& origin_url) { | |
58 std::string label; | |
59 if (is_main_resource) | |
60 label = "appcache.MainResourceResponseRetrieval"; | |
61 else | |
62 label = "appcache.SubResourceResponseRetrieval"; | |
63 UMA_HISTOGRAM_BOOLEAN(label, success); | |
Ilya Sherman
2014/03/26 21:51:31
This won't work. The label needs to be a runtime
michaeln
2014/03/26 22:58:53
oops thank you, and the one below too
| |
64 const std::string suffix = OriginToCustomHistogramSuffix(origin_url); | |
65 if (!suffix.empty()) { | |
66 base::BooleanHistogram::FactoryGet( | |
67 label + suffix, | |
68 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(success); | |
69 } | |
70 } | |
71 | |
72 void AppCacheHistograms::LogUpdateFailureStats( | |
73 const GURL& origin_url, | |
74 int percent_complete, | |
75 bool was_stalled, | |
76 bool was_off_origin_resource_failure) { | |
77 const std::string suffix = OriginToCustomHistogramSuffix(origin_url); | |
78 | |
79 std::string label = "appcache.UpdateProgressAtPointOfFaliure"; | |
80 UMA_HISTOGRAM_PERCENTAGE(label, percent_complete); | |
81 if (!suffix.empty()) { | |
82 base::LinearHistogram::FactoryGet( | |
83 label + suffix, | |
84 1, 101, 102, | |
85 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(percent_complete); | |
86 } | |
87 | |
88 label = "appcache.UpdateWasStalledAtPointOfFailure"; | |
jsbell
2014/03/26 22:59:52
Presumably this pattern will fail as well then? Bl
Ilya Sherman
2014/03/26 23:02:19
That's fine -- label is a runtime constant here.
| |
89 UMA_HISTOGRAM_BOOLEAN(label, was_stalled); | |
90 if (!suffix.empty()) { | |
91 base::BooleanHistogram::FactoryGet( | |
92 label + suffix, | |
93 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(was_stalled); | |
94 } | |
95 | |
96 label = "appcache.UpdateWasOffOriginAtPointOfFailure"; | |
97 UMA_HISTOGRAM_BOOLEAN(label, was_off_origin_resource_failure); | |
98 if (!suffix.empty()) { | |
99 base::BooleanHistogram::FactoryGet( | |
100 label + suffix, | |
101 base::HistogramBase::kUmaTargetedHistogramFlag)->Add( | |
102 was_off_origin_resource_failure); | |
103 } | |
104 } | |
105 | |
56 void AppCacheHistograms::AddTaskQueueTimeSample( | 106 void AppCacheHistograms::AddTaskQueueTimeSample( |
57 const base::TimeDelta& duration) { | 107 const base::TimeDelta& duration) { |
58 UMA_HISTOGRAM_TIMES("appcache.TaskQueueTime", duration); | 108 UMA_HISTOGRAM_TIMES("appcache.TaskQueueTime", duration); |
59 } | 109 } |
60 | 110 |
61 void AppCacheHistograms::AddTaskRunTimeSample( | 111 void AppCacheHistograms::AddTaskRunTimeSample( |
62 const base::TimeDelta& duration) { | 112 const base::TimeDelta& duration) { |
63 UMA_HISTOGRAM_TIMES("appcache.TaskRunTime", duration); | 113 UMA_HISTOGRAM_TIMES("appcache.TaskRunTime", duration); |
64 } | 114 } |
65 | 115 |
(...skipping 27 matching lines...) Expand all Loading... | |
93 } | 143 } |
94 | 144 |
95 void AppCacheHistograms::AddMissingManifestDetectedAtCallsite( | 145 void AppCacheHistograms::AddMissingManifestDetectedAtCallsite( |
96 MissingManifestCallsiteType callsite) { | 146 MissingManifestCallsiteType callsite) { |
97 UMA_HISTOGRAM_ENUMERATION( | 147 UMA_HISTOGRAM_ENUMERATION( |
98 "appcache.MissingManifestDetectedAtCallsite", | 148 "appcache.MissingManifestDetectedAtCallsite", |
99 callsite, NUM_MISSING_MANIFEST_CALLSITE_TYPES); | 149 callsite, NUM_MISSING_MANIFEST_CALLSITE_TYPES); |
100 } | 150 } |
101 | 151 |
102 } // namespace appcache | 152 } // namespace appcache |
OLD | NEW |