| 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 {
|
|
|