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

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

Issue 2769933003: Add more UMA to record whether parallel download is completed/interrupted/cancelled (Closed)
Patch Set: rebase Created 3 years, 9 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 | « content/browser/download/download_stats.h ('k') | 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 c4e4f046b6a98d96f9562151ee2f4ef82854a27e..3fcff94ed6e5de4685d2882b858da4f8f7c4e674 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -389,13 +389,21 @@ void RecordDownloadCompleted(const base::TimeTicks& start,
void RecordDownloadInterrupted(DownloadInterruptReason reason,
int64_t received,
- int64_t total) {
+ int64_t total,
+ bool uses_parallel_requests) {
RecordDownloadCount(INTERRUPTED_COUNT);
- UMA_HISTOGRAM_CUSTOM_ENUMERATION(
- "Download.InterruptedReason",
- reason,
+ if (uses_parallel_requests)
+ RecordParallelDownloadCount(INTERRUPTED_COUNT);
+
+ std::vector<base::HistogramBase::Sample> samples =
base::CustomHistogram::ArrayToCustomRanges(
- kAllInterruptReasonCodes, arraysize(kAllInterruptReasonCodes)));
+ kAllInterruptReasonCodes, arraysize(kAllInterruptReasonCodes));
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION("Download.InterruptedReason", reason,
+ samples);
+ if (uses_parallel_requests) {
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ "Download.InterruptedReason.ParallelDownload", reason, samples);
+ }
// The maximum should be 2^kBuckets, to have the logarithmic bucket
// boundaries fall on powers of 2.
@@ -410,32 +418,56 @@ void RecordDownloadInterrupted(DownloadInterruptReason reason,
1,
kMaxKb,
kBuckets);
+ if (uses_parallel_requests) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Download.InterruptedReceivedSizeK.ParallelDownload", received_kb, 1,
+ kMaxKb, kBuckets);
+ }
+
if (!unknown_size) {
UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedTotalSizeK",
total_kb,
1,
kMaxKb,
kBuckets);
+ if (uses_parallel_requests) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Download.InterruptedTotalSizeK.ParallelDownload", total_kb, 1,
+ kMaxKb, kBuckets);
+ }
if (delta_bytes == 0) {
RecordDownloadCount(INTERRUPTED_AT_END_COUNT);
- UMA_HISTOGRAM_CUSTOM_ENUMERATION(
- "Download.InterruptedAtEndReason",
- reason,
- base::CustomHistogram::ArrayToCustomRanges(
- kAllInterruptReasonCodes,
- arraysize(kAllInterruptReasonCodes)));
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION("Download.InterruptedAtEndReason",
+ reason, samples);
+
+ if (uses_parallel_requests) {
+ RecordParallelDownloadCount(INTERRUPTED_AT_END_COUNT);
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ "Download.InterruptedAtEndReason.ParallelDownload", reason,
+ samples);
+ }
} else if (delta_bytes > 0) {
UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedOverrunBytes",
delta_bytes,
1,
kMaxKb,
kBuckets);
+ if (uses_parallel_requests) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Download.InterruptedOverrunBytes.ParallelDownload", delta_bytes, 1,
+ kMaxKb, kBuckets);
+ }
} else {
UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedUnderrunBytes",
-delta_bytes,
1,
kMaxKb,
kBuckets);
+ if (uses_parallel_requests) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Download.InterruptedUnderrunBytes.ParallelDownload", -delta_bytes,
+ 1, kMaxKb, kBuckets);
+ }
}
}
@@ -736,6 +768,11 @@ void RecordFileBandwidth(size_t length,
CalculateBandwidthBytesPerSecond(length, disk_write_time));
}
+void RecordParallelDownloadCount(DownloadCountTypes type) {
+ UMA_HISTOGRAM_ENUMERATION("Download.Counts.ParallelDownload", type,
+ DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
+}
+
void RecordParallelDownloadStats(
size_t bytes_downloaded_with_parallel_streams,
base::TimeDelta time_with_parallel_streams,
« no previous file with comments | « content/browser/download/download_stats.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698