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

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

Issue 2874603002: Add the metric to record percentage improvement for parallel download. (Closed)
Patch Set: Rebased. 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 ed24173103d329447919b88f2719b61ad1ccbd6f..708615419d511191b4d563bd5c0584f514c90476 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -819,16 +819,34 @@ void RecordParallelizableDownloadStats(
base::TimeDelta time_saved;
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 > 0) {
time_saved = base::TimeDelta::FromMilliseconds(
1000.0 * bytes_downloaded_with_parallel_streams /
bandwidth_without_parallel_streams) -
time_with_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 non_parallel_time = base::TimeDelta::FromSecondsD(
+ static_cast<double>(total_size) / bandwidth_without_parallel_streams);
+ int time_ratio_percentage =
+ 100.0 * total_time.InSecondsF() / non_parallel_time.InSecondsF();
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Download.ParallelDownload.TotalTimeRatioPercentage",
+ time_ratio_percentage, 0, 200, 101);
}
}
« 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