Chromium Code Reviews| Index: content/browser/download/download_stats.cc |
| diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc |
| index 80be40f4e3e4849ac5ddbd5696f55f516f334690..87561929d2974eacbfc09c62bef95d089d35be96 100644 |
| --- a/content/browser/download/download_stats.cc |
| +++ b/content/browser/download/download_stats.cc |
| @@ -818,11 +818,32 @@ void RecordParallelizableDownloadStats( |
| return; |
| if (bytes_downloaded_with_parallel_streams > 0) { |
| + int64_t bandwidth_with_parallel_streams = CalculateBandwidthBytesPerSecond( |
| + bytes_downloaded_with_parallel_streams, time_with_parallel_streams); |
| RecordBandwidthMetric( |
| "Download.ParallelizableDownloadBandwidth." |
| "WithParallelRequestsMultipleStreams", |
| - CalculateBandwidthBytesPerSecond(bytes_downloaded_with_parallel_streams, |
| - time_with_parallel_streams)); |
| + bandwidth_with_parallel_streams); |
| + |
| + if (bandwidth_without_parallel_streams) { |
| + int bandwidth_ratio_percentage = |
| + (100.0 * bandwidth_with_parallel_streams) / |
| + bandwidth_without_parallel_streams; |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Download.ParallelDownload.BandwidthRatioPercentage", |
| + bandwidth_ratio_percentage, 0, 400, 101); |
| + base::TimeDelta total_time = |
| + time_with_parallel_streams + time_without_parallel_streams; |
| + size_t total_size = bytes_downloaded_with_parallel_streams + |
| + bytes_downloaded_without_parallel_streams; |
| + base::TimeDelta improved_time = base::TimeDelta::FromSecondsD( |
| + static_cast<double>(total_size) / bandwidth_with_parallel_streams); |
| + int time_ratio_percentage = |
|
qinmin
2017/05/10 18:46:47
This doesn't seem right.
When we say that parallel
xingliu
2017/05/10 20:08:06
Done. Makes sense.
|
| + 100.0 * improved_time.InSecondsF() / total_time.InSecondsF(); |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Download.ParallelDownload.TotalTimeRatioPercentage", |
| + time_ratio_percentage, 0, 200, 101); |
| + } |
| } |
| base::TimeDelta time_saved; |