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

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: 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..70e03f6c5a3bda31e277017ee4d60d3d5ce8b66c 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_thumbnail_fallbacks_,
+ number_of_thumbnail_with_fallback_attempts_);
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_thumbnail_with_fallback_attempts_ != 0) {
+ UMA_HISTOGRAM_PERCENTAGE(
+ "NewTabPage.ThumbnailFallbackRate",
+ GetPercentError(number_of_thumbnail_fallbacks_,
+ number_of_thumbnail_with_fallback_attempts_));
}
number_of_thumbnail_attempts_ = 0;
number_of_thumbnail_errors_ = 0;
+ number_of_thumbnail_with_fallback_attempts_ = 0;
+ number_of_thumbnail_fallbacks_ = 0;
}
void NTPUserDataLogger::EmitMouseoverCount() {
@@ -40,6 +51,12 @@ void NTPUserDataLogger::LogEvent(NTPLoggingEventType event) {
case NTP_THUMBNAIL_ERROR:
number_of_thumbnail_errors_++;
break;
+ case NTP_THUMBNAIL_WITH_FALLBACK_ATTEMPT:
+ number_of_thumbnail_with_fallback_attempts_++;
+ break;
+ case NTP_THUMBNAIL_FALLBACK:
+ number_of_thumbnail_fallbacks_++;
+ 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_thumbnail_with_fallback_attempts_(0),
+ number_of_thumbnail_fallbacks_(0) {
}
size_t NTPUserDataLogger::GetPercentError(size_t errors, size_t events) const {

Powered by Google App Engine
This is Rietveld 408576698