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

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

Issue 83943002: Adding UMA metric to record the type of suggestion displayed on the NTP's Most Visited section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 1b06895b2ec53ce2acb4348c5815c45094f46cbb..54e01d801c491170d946bb71aaf1e19e3ac4d192 100644
--- a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
@@ -10,6 +10,17 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/navigation_details.h"
+namespace {
+
+// Used to track if suggestions were issued by the client or the server.
+enum SuggestionsType {
+ CLIENT_SIDE = 0,
+ SERVER_SIDE = 1,
+ SUGGESTIONS_TYPE_COUNT = 2
+};
+
+} // namespace
+
DEFINE_WEB_CONTENTS_USER_DATA_KEY(NTPUserDataLogger);
NTPUserDataLogger::~NTPUserDataLogger() {}
@@ -30,10 +41,15 @@ void NTPUserDataLogger::EmitThumbnailErrorRate() {
GetPercentError(number_of_fallback_thumbnails_used_,
number_of_fallback_thumbnails_requested_));
}
+ UMA_HISTOGRAM_ENUMERATION(
+ "NewTabPage.SuggestionsType",
+ server_side_suggestions_ ? SERVER_SIDE : CLIENT_SIDE,
+ SUGGESTIONS_TYPE_COUNT);
number_of_thumbnail_attempts_ = 0;
number_of_thumbnail_errors_ = 0;
number_of_fallback_thumbnails_requested_ = 0;
number_of_fallback_thumbnails_used_ = 0;
+ server_side_suggestions_ = false;
}
void NTPUserDataLogger::EmitMouseoverCount() {
@@ -58,6 +74,9 @@ void NTPUserDataLogger::LogEvent(NTPLoggingEventType event) {
case NTP_FALLBACK_THUMBNAIL_USED:
number_of_fallback_thumbnails_used_++;
break;
+ case NTP_SERVER_SIDE_SUGGESTION:
+ server_side_suggestions_ = true;
+ break;
default:
NOTREACHED();
}
@@ -84,7 +103,8 @@ NTPUserDataLogger::NTPUserDataLogger(content::WebContents* contents)
number_of_thumbnail_attempts_(0),
number_of_thumbnail_errors_(0),
number_of_fallback_thumbnails_requested_(0),
- number_of_fallback_thumbnails_used_(0) {
+ number_of_fallback_thumbnails_used_(0),
+ server_side_suggestions_(false) {
}
size_t NTPUserDataLogger::GetPercentError(size_t errors, size_t events) const {

Powered by Google App Engine
This is Rietveld 408576698