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

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

Issue 8008021: Add new UMA stats to get a handle on Downloads UI Usage (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 9 years, 2 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 1abbc8c48fdd9ace389cf5524dd28889c9c45165..3f73b45eb4a2f6721e20dd33bd97a334eec09bd9 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -173,4 +173,56 @@ void RecordDownloadMimeType(const std::string& mime_type_string) {
DOWNLOAD_CONTENT_MAX);
}
+void RecordOpen(const base::Time& end, bool first) {
+ if (!end.is_null()) {
+ UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end));
+ if (first) {
+ UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime",
+ (base::Time::Now() - end));
+ }
+ }
+}
+
+void RecordHistorySize(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.HistorySize",
+ size,
+ 0/*min*/,
+ (1 << 10)/*max*/,
+ 32/*num_buckets*/);
+}
+
+void RecordShelfClose(int size, int pending, bool autoclose) {
+ if (autoclose) {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnAutoClose",
+ size,
+ 128);
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfPendingSizeOnAutoClose",
+ pending,
+ 128);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnUserClose",
+ size,
+ 128);
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfPendingSizeOnUserClose",
+ pending,
+ 128);
+ }
+}
+
+void RecordClearAllSize(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize",
+ size,
+ 0/*min*/,
+ (1 << 10)/*max*/,
+ 32/*num_buckets*/);
+}
+
+void RecordOpensOutstanding(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding",
+ size,
+ 0/*min*/,
+ (1 << 10)/*max*/,
+ 32/*num_buckets*/);
+}
+
} // namespace download_stats

Powered by Google App Engine
This is Rietveld 408576698