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

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

Issue 2806653002: Add UMA to track why a download is non-parallel when enabled parallel (Closed)
Patch Set: Minor comment polish. Created 3 years, 8 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.h
diff --git a/content/browser/download/download_stats.h b/content/browser/download/download_stats.h
index 0c4a5be726edf4de5dd19f07118aec46ae9dce35..cd28ce944397f6820f71fd4a0189ad90d76a2786 100644
--- a/content/browser/download/download_stats.h
+++ b/content/browser/download/download_stats.h
@@ -145,6 +145,37 @@ enum DownloadDiscardReason {
DOWNLOAD_DISCARD_DUE_TO_SHUTDOWN
};
+// When parallel download is enabled, the download may fall back to a normal
+// download for various reasons. This enum counts the number of parallel
+// download and fallbacks. Also records the reasons why the download falls back
+// to a normal download. The reasons are not mutual exclusive.
+enum class ParallelDownloadCreationEvent {
Ilya Sherman 2017/04/08 01:22:46 nit: Please document that this enum is used to bac
xingliu 2017/04/10 18:56:30 Done.
+ // The total number of downloads created as parallel download.
+ PARALLEL_DOWNLOAD_COUNT = 0,
Ilya Sherman 2017/04/08 01:22:46 Optional nit: I still think it's weird to use "COU
xingliu 2017/04/10 18:56:30 Done.
+
+ // The total number of downloads fall back to normal download when parallel
+ // download is enabled.
+ FALLBACK_TO_NORMAL_DOWNLOAD_COUNT,
+
+ // No ETag or Last-Modified response header.
+ FALLBACK_REASON_STRONG_VALIDATORS,
+
+ // No Accept-Range response header.
+ FALLBACK_REASON_ACCEPT_RANGE_HEADER,
+
+ // No Content-Length response header.
+ FALLBACK_REASON_CONTENT_LENGTH_HEADER,
+
+ // File size is not complied to finch configuration.
+ FALLBACK_REASON_FILE_SIZE,
+
+ // The HTTP connection type does not meet the requirement.
+ FALLBACK_REASON_CONNECTION_TYPE,
+
+ // Last entry of the enum.
+ MAX,
Ilya Sherman 2017/04/08 01:22:46 Optional nit: IMO "max" makes sense to use as an a
xingliu 2017/04/10 18:56:30 Done.
+};
+
// Increment one of the above counts.
void RecordDownloadCount(DownloadCountTypes type);
@@ -236,6 +267,10 @@ void RecordParallelDownloadStats(
size_t bytes_downloaded_without_parallel_streams,
base::TimeDelta time_without_parallel_streams);
+// Records the parallel download creation counts and the reasons why the
+// download falls back to non-parallel download.
+void RecordParallelDownloadCreationEvent(ParallelDownloadCreationEvent event);
+
// Record the result of a download file rename.
void RecordDownloadFileRenameResultAfterRetry(
base::TimeDelta time_since_first_failure,

Powered by Google App Engine
This is Rietveld 408576698