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

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: merge 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
« no previous file with comments | « content/browser/download/download_stats.h ('k') | no next file » | 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 be43ba0d1a46e3a3f1833b404cc4f224e77d956c..856e62af9fa63b9d8c839e4e371edec791b2b125 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -177,4 +177,57 @@ 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 in_progress, bool autoclose) {
+ static const int kMaxShelfSize = 16;
+ if (autoclose) {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnAutoClose",
+ size,
+ kMaxShelfSize);
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfInProgressSizeOnAutoClose",
+ in_progress,
+ kMaxShelfSize);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnUserClose",
+ size,
+ kMaxShelfSize);
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfInProgressSizeOnUserClose",
+ in_progress,
+ kMaxShelfSize);
+ }
+}
+
+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*/,
+ 64/*num_buckets*/);
+}
+
} // namespace download_stats
« no previous file with comments | « content/browser/download/download_stats.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698