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

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: 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
Index: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index 0bfb00271b99a6cbb6acbab0414b2799a665f378..c9e328d9706bd1067ee81db65bc1cad263d8f1f4 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -389,10 +389,19 @@ void RecordDownloadCompleted(const base::TimeTicks& start,
void RecordDownloadInterrupted(DownloadInterruptReason reason,
int64_t received,
- int64_t total) {
- RecordDownloadCount(INTERRUPTED_COUNT);
+ int64_t total,
+ bool uses_parallel_requests) {
+ if (uses_parallel_requests)
+ RecordParallelDownloadCount(PARALLEL_DOWNLOAD_INTERRUPTED_COUNT);
+ else
+ RecordDownloadCount(INTERRUPTED_COUNT);
+
+ std::string histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedReason" :
+ "Download.InterruptedReason";
+
UMA_HISTOGRAM_CUSTOM_ENUMERATION(
- "Download.InterruptedReason",
+ histogram_name,
reason,
base::CustomHistogram::ArrayToCustomRanges(
kAllInterruptReasonCodes, arraysize(kAllInterruptReasonCodes)));
@@ -405,33 +414,52 @@ void RecordDownloadInterrupted(DownloadInterruptReason reason,
bool unknown_size = total <= 0;
int64_t received_kb = received / 1024;
int64_t total_kb = total / 1024;
- UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedReceivedSizeK",
+ histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedReceivedSizeK" :
+ "Download.InterruptedReceivedSizeK";
+
+ UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_name,
received_kb,
1,
kMaxKb,
kBuckets);
if (!unknown_size) {
- UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedTotalSizeK",
+ histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedTotalSizeK" :
+ "Download.InterruptedTotalSizeK";
+ UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_name,
total_kb,
1,
kMaxKb,
kBuckets);
if (delta_bytes == 0) {
- RecordDownloadCount(INTERRUPTED_AT_END_COUNT);
+ if (uses_parallel_requests)
+ RecordParallelDownloadCount(PARALLEL_DOWNLOAD_INTERRUPTED_AT_END_COUNT);
+ else
+ RecordDownloadCount(INTERRUPTED_AT_END_COUNT);
+ histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedAtEndReason" :
+ "Download.InterruptedAtEndReason";
UMA_HISTOGRAM_CUSTOM_ENUMERATION(
- "Download.InterruptedAtEndReason",
+ histogram_name,
reason,
base::CustomHistogram::ArrayToCustomRanges(
kAllInterruptReasonCodes,
arraysize(kAllInterruptReasonCodes)));
} else if (delta_bytes > 0) {
- UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedOverrunBytes",
+ histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedOverrunBytes" :
+ "Download.InterruptedOverrunBytes";
+ UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_name,
delta_bytes,
1,
kMaxKb,
kBuckets);
} else {
- UMA_HISTOGRAM_CUSTOM_COUNTS("Download.InterruptedUnderrunBytes",
+ histogram_name = uses_parallel_requests ?
+ "Download.ParallelDownloadInterruptedUnderrunBytes" :
+ "Download.InterruptedUnderrunBytes";
+ UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_name,
-delta_bytes,
1,
kMaxKb,
@@ -726,6 +754,12 @@ void RecordFileBandwidth(size_t length,
CalculateBandwidthBytesPerSecond(length, disk_write_time));
}
+void RecordParallelDownloadCount(ParallelDownloadCountTypes type) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Download.ParallelDownloadCounts", type,
+ PARALLEL_DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
+}
+
void RecordParallelDownloadStats(
size_t bytes_downloaded_with_parallel_streams,
base::TimeDelta time_with_parallel_streams,

Powered by Google App Engine
This is Rietveld 408576698