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

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: fix windows auto_closed_ 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..d6daf3c3b18d652dbe87b9bd46173fc92a186954 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 in_progress, bool autoclose) {
+ if (autoclose) {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnAutoClose",
+ size,
+ 128);
Randy Smith (Not in Mondays) 2011/10/09 23:40:17 Hmmm. Thinking about it, why 128? There's a way
benjhayden 2011/10/10 16:27:11 16?
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfInProgressSizeOnAutoClose",
+ in_progress,
+ 128);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSizeOnUserClose",
+ size,
+ 128);
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfInProgressSizeOnUserClose",
+ in_progress,
+ 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*/);
Randy Smith (Not in Mondays) 2011/10/09 23:40:17 And hear I'd actually increase the number of bucke
benjhayden 2011/10/10 16:27:11 64?
+}
+
} // namespace download_stats

Powered by Google App Engine
This is Rietveld 408576698