Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2538)

Unified Diff: content/browser/download/download_stats.cc

Issue 2874603002: Add the metric to record percentage improvement for parallel download. (Closed)
Patch Set: Change bucket granularity. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698