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 "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 #include "content/browser/download/download_resource_handler.h" | 9 #include "content/browser/download/download_resource_handler.h" |
10 #include "content/public/browser/download_interrupt_reasons.h" | 10 #include "content/public/browser/download_interrupt_reasons.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 void RecordOpen(const base::Time& end, bool first) { | 271 void RecordOpen(const base::Time& end, bool first) { |
272 if (!end.is_null()) { | 272 if (!end.is_null()) { |
273 UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end)); | 273 UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end)); |
274 if (first) { | 274 if (first) { |
275 UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime", | 275 UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime", |
276 (base::Time::Now() - end)); | 276 (base::Time::Now() - end)); |
277 } | 277 } |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 void RecordHistorySize(int size) { | |
282 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.HistorySize2", | |
283 size, | |
284 0/*min*/, | |
285 (1 << 23)/*max*/, | |
286 (1 << 7)/*num_buckets*/); | |
287 } | |
288 | |
289 void RecordClearAllSize(int size) { | 281 void RecordClearAllSize(int size) { |
290 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize", | 282 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize", |
291 size, | 283 size, |
292 0/*min*/, | 284 0/*min*/, |
293 (1 << 10)/*max*/, | 285 (1 << 10)/*max*/, |
294 32/*num_buckets*/); | 286 32/*num_buckets*/); |
295 } | 287 } |
296 | 288 |
297 void RecordOpensOutstanding(int size) { | 289 void RecordOpensOutstanding(int size) { |
298 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding", | 290 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding", |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 disk_write_time_ms * 100 / elapsed_time_ms); | 332 disk_write_time_ms * 100 / elapsed_time_ms); |
341 } | 333 } |
342 | 334 |
343 void RecordSavePackageEvent(SavePackageEvent event) { | 335 void RecordSavePackageEvent(SavePackageEvent event) { |
344 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage", | 336 UMA_HISTOGRAM_ENUMERATION("Download.SavePackage", |
345 event, | 337 event, |
346 SAVE_PACKAGE_LAST_ENTRY); | 338 SAVE_PACKAGE_LAST_ENTRY); |
347 } | 339 } |
348 | 340 |
349 } // namespace download_stats | 341 } // namespace download_stats |
OLD | NEW |