OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/download/download_stats.h" | 5 #include "content/browser/download/download_stats.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 | 9 |
10 namespace download_stats { | 10 namespace download_stats { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 download_content = DOWNLOAD_CONTENT_VIDEO; | 166 download_content = DOWNLOAD_CONTENT_VIDEO; |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 // Record the value. | 170 // Record the value. |
171 UMA_HISTOGRAM_ENUMERATION("Download.ContentType", | 171 UMA_HISTOGRAM_ENUMERATION("Download.ContentType", |
172 download_content, | 172 download_content, |
173 DOWNLOAD_CONTENT_MAX); | 173 DOWNLOAD_CONTENT_MAX); |
174 } | 174 } |
175 | 175 |
176 void RecordOpen(const base::Time& end, bool first) { | |
177 if (!end.is_null()) { | |
178 UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end)); | |
179 if (first) { | |
180 UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime", | |
181 (base::Time::Now() - end)); | |
182 } | |
183 } | |
184 } | |
185 | |
186 void RecordHistorySize(int size) { | |
187 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.HistorySize", | |
188 size, | |
189 0/*min*/, | |
190 kint32max/*max*/, | |
191 (1 << 10)/*num_buckets*/); | |
Randy Smith (Not in Mondays)
2011/09/30 15:57:21
Why such large numbers for max and num buckets (es
benjhayden
2011/10/03 20:54:39
Done.
| |
192 } | |
193 | |
194 void RecordHistorySize2(int size) { | |
195 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.HistorySize2", | |
196 size, | |
197 0/*min*/, | |
198 kint32max/*max*/, | |
199 (1 << 10)/*num_buckets*/); | |
Randy Smith (Not in Mondays)
2011/09/30 15:57:21
See above.
benjhayden
2011/10/03 20:54:39
Done.
| |
200 } | |
201 | |
202 void RecordShelfSize(int size) { | |
203 UMA_HISTOGRAM_ENUMERATION("Download.ShelfSize", | |
204 size, | |
205 128); | |
206 } | |
207 | |
208 void RecordShelfPendingSize(int size) { | |
209 UMA_HISTOGRAM_ENUMERATION("Download.ShelfPendingSize", | |
210 size, | |
211 128); | |
212 } | |
213 | |
214 void RecordClearAllSize(int size) { | |
215 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize", | |
216 size, | |
217 0/*min*/, | |
218 kint32max/*max*/, | |
219 (1 << 10)/*num_buckets*/); | |
Randy Smith (Not in Mondays)
2011/09/30 15:57:21
See above. I'd imagine we're really only interest
benjhayden
2011/10/03 20:54:39
I thought that we were also looking to objectively
| |
220 } | |
221 | |
222 void RecordOpensOutstanding(int size) { | |
223 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding", | |
224 size, | |
225 0/*min*/, | |
226 kint32max/*max*/, | |
227 (1 << 10)/*num_buckets*/); | |
Randy Smith (Not in Mondays)
2011/09/30 15:57:21
See comment immediately above (including the three
benjhayden
2011/10/03 20:54:39
Done.
| |
228 } | |
229 | |
176 } // namespace download_stats | 230 } // namespace download_stats |
OLD | NEW |