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

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: fixed tests Created 9 years, 3 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..dde9078708ac940675c6c988e797c92162a7d9cc 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -173,4 +173,58 @@ 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*/,
+ kint32max/*max*/,
+ (1 << 10)/*num_buckets*/);
Randy Smith (Not in Mondays) 2011/09/30 15:57:21 Why such large numbers for max and num buckets (es
benjhayden 2011/10/03 20:54:39 Done.
+}
+
+void RecordHistorySize2(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.HistorySize2",
+ size,
+ 0/*min*/,
+ kint32max/*max*/,
+ (1 << 10)/*num_buckets*/);
Randy Smith (Not in Mondays) 2011/09/30 15:57:21 See above.
benjhayden 2011/10/03 20:54:39 Done.
+}
+
+void RecordShelfSize(int size) {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfSize",
+ size,
+ 128);
+}
+
+void RecordShelfPendingSize(int size) {
+ UMA_HISTOGRAM_ENUMERATION("Download.ShelfPendingSize",
+ size,
+ 128);
+}
+
+void RecordClearAllSize(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize",
+ size,
+ 0/*min*/,
+ kint32max/*max*/,
+ (1 << 10)/*num_buckets*/);
Randy Smith (Not in Mondays) 2011/09/30 15:57:21 See above. I'd imagine we're really only interest
benjhayden 2011/10/03 20:54:39 I thought that we were also looking to objectively
+}
+
+void RecordOpensOutstanding(int size) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding",
+ size,
+ 0/*min*/,
+ kint32max/*max*/,
+ (1 << 10)/*num_buckets*/);
Randy Smith (Not in Mondays) 2011/09/30 15:57:21 See comment immediately above (including the three
benjhayden 2011/10/03 20:54:39 Done.
+}
+
} // namespace download_stats

Powered by Google App Engine
This is Rietveld 408576698