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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc

Issue 23874005: Ensure the 1993 NTP logs to UMA Most Visited tiles that use the fallback thumbnail instead of the p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change to histograms.xml Created 7 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: chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
index 95d86ed2b587601324347e38b26d35404e244337..aa6d2c9930e0a3d4188fd0fd2a18fefe22a3932b 100644
--- a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
@@ -15,13 +15,24 @@ NTPUserDataLogger::~NTPUserDataLogger() {}
void NTPUserDataLogger::EmitThumbnailErrorRate() {
DCHECK_LE(number_of_thumbnail_errors_, number_of_thumbnail_attempts_);
+ DCHECK_LE(number_of_fallback_thumbnails_used_,
+ number_of_fallback_thumbnails_requested_);
Alexei Svitkine (slow) 2013/09/05 14:59:25 Nit: Move this above the if block that logs it.
beaudoin 2013/09/05 15:02:55 Done.
if (number_of_thumbnail_attempts_ != 0) {
- UMA_HISTOGRAM_PERCENTAGE("NewTabPage.ThumbnailErrorRate",
- GetPercentError(number_of_thumbnail_errors_,
- number_of_thumbnail_attempts_));
+ UMA_HISTOGRAM_PERCENTAGE(
+ "NewTabPage.ThumbnailErrorRate",
+ GetPercentError(number_of_thumbnail_errors_,
+ number_of_thumbnail_attempts_));
+ }
+ if (number_of_fallback_thumbnails_requested_ != 0) {
+ UMA_HISTOGRAM_PERCENTAGE(
+ "NewTabPage.ThumbnailFallbackRate",
+ GetPercentError(number_of_fallback_thumbnails_used_,
+ number_of_fallback_thumbnails_requested_));
}
number_of_thumbnail_attempts_ = 0;
number_of_thumbnail_errors_ = 0;
+ number_of_fallback_thumbnails_requested_ = 0;
+ number_of_fallback_thumbnails_used_ = 0;
}
void NTPUserDataLogger::EmitMouseoverCount() {
@@ -40,6 +51,12 @@ void NTPUserDataLogger::LogEvent(NTPLoggingEventType event) {
case NTP_THUMBNAIL_ERROR:
number_of_thumbnail_errors_++;
break;
+ case NTP_FALLBACK_THUMBNAIL_REQUESTED:
+ number_of_fallback_thumbnails_requested_++;
+ break;
+ case NTP_FALLBACK_THUMBNAIL_USED:
+ number_of_fallback_thumbnails_used_++;
+ break;
default:
NOTREACHED();
}
@@ -64,7 +81,9 @@ NTPUserDataLogger::NTPUserDataLogger(content::WebContents* contents)
: content::WebContentsObserver(contents),
number_of_mouseovers_(0),
number_of_thumbnail_attempts_(0),
- number_of_thumbnail_errors_(0) {
+ number_of_thumbnail_errors_(0),
+ number_of_fallback_thumbnails_requested_(0),
+ number_of_fallback_thumbnails_used_(0) {
}
size_t NTPUserDataLogger::GetPercentError(size_t errors, size_t events) const {

Powered by Google App Engine
This is Rietveld 408576698