Commit 34da24b9 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Adds notice card and network duration fetch to feed metrics recorder

The first one will be used to record notice card (or lack of) impressions,
and the second one to record the time it takes to fetch articles.

Bug: 1145379
Change-Id: I481e86dea3f47d5db8364d87092393bcbcdd00d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551851
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarAdam Trudeau-Arcaro <adamta@google.com>
Cr-Commit-Position: refs/heads/master@{#830261}
parent 276535cc
...@@ -83,6 +83,14 @@ ...@@ -83,6 +83,14 @@
// Records an unknown |commandID| performed by the Feed. // Records an unknown |commandID| performed by the Feed.
- (void)recordCommandID:(int)commandID; - (void)recordCommandID:(int)commandID;
// Records if a notice card was presented at the time the feed was initially
// loaded. e.g. Launch time, user refreshes, and acccount switches.
- (void)recordNoticeCardShown:(BOOL)shown;
// Records the |durationInSeconds| it took to Discover feed to Fetch articles.
- (void)recordFeedArticlesFetchDurationInSeconds:
(NSTimeInterval)durationInSeconds;
@end @end
#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_DISCOVER_FEED_METRICS_RECORDER_H_ #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_DISCOVER_FEED_METRICS_RECORDER_H_
...@@ -107,6 +107,14 @@ const char kDiscoverFeedUserActionInfiniteFeedTriggered[] = ...@@ -107,6 +107,14 @@ const char kDiscoverFeedUserActionInfiniteFeedTriggered[] =
const char kDiscoverFeedEngagementTypeHistogram[] = const char kDiscoverFeedEngagementTypeHistogram[] =
"ContentSuggestions.Feed.EngagementType"; "ContentSuggestions.Feed.EngagementType";
// Histogram name to capture Feed Notice card impressions.
const char kDiscoverFeedNoticeCardFulfilled[] =
"ContentSuggestions.Feed.NoticeCardFulfilled2";
// Histogram name to measure the time it tood the Feed to fetch articles.
const char kDiscoverFeedArticlesFetchNetworkDuration[] =
"ContentSuggestions.Feed.Network.Duration";
// Minimum scrolling amount to record a FeedEngagementType::kFeedEngaged due to // Minimum scrolling amount to record a FeedEngagementType::kFeedEngaged due to
// scrolling. // scrolling.
const int kMinScrollThreshold = 160; const int kMinScrollThreshold = 160;
...@@ -279,6 +287,16 @@ const int kMinutesBetweenSessions = 5; ...@@ -279,6 +287,16 @@ const int kMinutesBetweenSessions = 5;
base::UmaHistogramSparse(kDiscoverFeedUserActionCommandHistogram, commandID); base::UmaHistogramSparse(kDiscoverFeedUserActionCommandHistogram, commandID);
} }
- (void)recordNoticeCardShown:(BOOL)shown {
base::UmaHistogramBoolean(kDiscoverFeedNoticeCardFulfilled, shown);
}
- (void)recordFeedArticlesFetchDurationInSeconds:
(NSTimeInterval)durationInSeconds {
UMA_HISTOGRAM_MEDIUM_TIMES(kDiscoverFeedArticlesFetchNetworkDuration,
base::TimeDelta::FromSeconds(durationInSeconds));
}
#pragma mark - Private #pragma mark - Private
// Records histogram metrics for Discover feed user actions. // Records histogram metrics for Discover feed user actions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment