Chromium Code Reviews| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/histogram_functions.h" | 8 #include "base/metrics/histogram_functions.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 766 RecordBandwidthMetric( | 766 RecordBandwidthMetric( |
| 767 "Download.BandwidthDiskBytesPerSecond", | 767 "Download.BandwidthDiskBytesPerSecond", |
| 768 CalculateBandwidthBytesPerSecond(length, disk_write_time)); | 768 CalculateBandwidthBytesPerSecond(length, disk_write_time)); |
| 769 } | 769 } |
| 770 | 770 |
| 771 void RecordParallelDownloadCount(DownloadCountTypes type) { | 771 void RecordParallelDownloadCount(DownloadCountTypes type) { |
| 772 UMA_HISTOGRAM_ENUMERATION("Download.Counts.ParallelDownload", type, | 772 UMA_HISTOGRAM_ENUMERATION("Download.Counts.ParallelDownload", type, |
| 773 DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 773 DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
| 774 } | 774 } |
| 775 | 775 |
| 776 void RecordParallelDownloadRequestCount(int request_count) { | |
| 777 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ParallelDownloadRequestCount", | |
| 778 request_count, 1, 10, 10); | |
|
Ilya Sherman
2017/03/31 00:33:04
nit: Did you check that this gives you the desired
xingliu
2017/03/31 21:48:26
Done, thanks.
| |
| 779 } | |
| 780 | |
| 781 void RecordParallelDownloadEarlyRequests(int request_count) { | |
| 782 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ParallelDownloadEarlyRequestCount", | |
| 783 request_count, 1, 10, 10); | |
| 784 } | |
| 785 | |
| 786 void RecordParallelDownloadAddStreamSuccess(bool success) { | |
| 787 UMA_HISTOGRAM_BOOLEAN("Download.ParallelDownloadAddStreamSuccess", success); | |
| 788 } | |
| 789 | |
| 776 void RecordParallelDownloadStats( | 790 void RecordParallelDownloadStats( |
| 777 size_t bytes_downloaded_with_parallel_streams, | 791 size_t bytes_downloaded_with_parallel_streams, |
| 778 base::TimeDelta time_with_parallel_streams, | 792 base::TimeDelta time_with_parallel_streams, |
| 779 size_t bytes_downloaded_without_parallel_streams, | 793 size_t bytes_downloaded_without_parallel_streams, |
| 780 base::TimeDelta time_without_parallel_streams) { | 794 base::TimeDelta time_without_parallel_streams) { |
| 781 int bandwidth_without_parallel_streams = CalculateBandwidthBytesPerSecond( | 795 int bandwidth_without_parallel_streams = CalculateBandwidthBytesPerSecond( |
| 782 bytes_downloaded_without_parallel_streams, time_without_parallel_streams); | 796 bytes_downloaded_without_parallel_streams, time_without_parallel_streams); |
| 783 RecordBandwidthMetric( | 797 RecordBandwidthMetric( |
| 784 "Download.BandwidthWithoutParallelStreamsBytesPerSecond", | 798 "Download.BandwidthWithoutParallelStreamsBytesPerSecond", |
| 785 bandwidth_without_parallel_streams); | 799 bandwidth_without_parallel_streams); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 885 if (!page_transition) | 899 if (!page_transition) |
| 886 return; | 900 return; |
| 887 | 901 |
| 888 UMA_HISTOGRAM_ENUMERATION( | 902 UMA_HISTOGRAM_ENUMERATION( |
| 889 "Download.PageTransition", | 903 "Download.PageTransition", |
| 890 ui::PageTransitionStripQualifier(page_transition.value()), | 904 ui::PageTransitionStripQualifier(page_transition.value()), |
| 891 ui::PAGE_TRANSITION_LAST_CORE + 1); | 905 ui::PAGE_TRANSITION_LAST_CORE + 1); |
| 892 } | 906 } |
| 893 | 907 |
| 894 } // namespace content | 908 } // namespace content |
| OLD | NEW |