Commit 8915896f authored by Xinghui Lu's avatar Xinghui Lu Committed by Chromium LUCI CQ

Log the time to get referrer from Safe Browsing navigation observer

We plan to add referrer to real time URL check and would like to
know the latency of obtaining referrer from Safe Browsing navigation
observer. We don't plan to preserve these metrics for a long time, so
they are set to be expired in three months.

Metrics added:
SafeBrowsing.NavigationObserver.IdentifyReferrerChainByEventURLTime
SafeBrowsing.NavigationObserver.IdentifyReferrerChainByWebContentsTime
SafeBrowsing.NavigationObserver.AppendRecentNavigationsTime

Bug: 1161342
Change-Id: I1fc9431aa37cfd472bffebdbdda26bcbd352c632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601544
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840418}
parent ffff1312
......@@ -380,6 +380,8 @@ SafeBrowsingNavigationObserverManager::IdentifyReferrerChainByEventURL(
SessionID event_tab_id,
int user_gesture_count_limit,
ReferrerChain* out_referrer_chain) {
SCOPED_UMA_HISTOGRAM_TIMER(
"SafeBrowsing.NavigationObserver.IdentifyReferrerChainByEventURLTime");
if (!event_url.is_valid())
return INVALID_URL;
......@@ -404,6 +406,8 @@ SafeBrowsingNavigationObserverManager::IdentifyReferrerChainByWebContents(
content::WebContents* web_contents,
int user_gesture_count_limit,
ReferrerChain* out_referrer_chain) {
SCOPED_UMA_HISTOGRAM_TIMER(
"SafeBrowsing.NavigationObserver.IdentifyReferrerChainByWebContentsTime");
if (!web_contents)
return INVALID_URL;
GURL last_committed_url = web_contents->GetLastCommittedURL();
......@@ -525,6 +529,8 @@ size_t SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend(
void SafeBrowsingNavigationObserverManager::AppendRecentNavigations(
size_t recent_navigation_count,
ReferrerChain* out_referrer_chain) {
SCOPED_UMA_HISTOGRAM_TIMER(
"SafeBrowsing.NavigationObserver.AppendRecentNavigationsTime");
if (recent_navigation_count <= 0u)
return;
int current_referrer_chain_size = out_referrer_chain->size();
......
......@@ -705,6 +705,38 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="SafeBrowsing.NavigationObserver.AppendRecentNavigationsTime"
units="ms" expires_after="2021-04-05">
<owner>xinghuilu@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<summary>
Logs the time it takes to append recent navigations. Logged each time the
function is called.
</summary>
</histogram>
<histogram
name="SafeBrowsing.NavigationObserver.IdentifyReferrerChainByEventURLTime"
units="ms" expires_after="2021-04-05">
<owner>xinghuilu@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<summary>
Logs the time it takes to identify referrer chain by event URL. Logged each
time the function is called.
</summary>
</histogram>
<histogram
name="SafeBrowsing.NavigationObserver.IdentifyReferrerChainByWebContentsTime"
units="ms" expires_after="2021-04-05">
<owner>xinghuilu@chromium.org</owner>
<owner>chrome-safebrowsing-alerts@google.com</owner>
<summary>
Logs the time it takes to identify referrer chain by web contents. Logged
each time the function is called.
</summary>
</histogram>
<histogram name="SafeBrowsing.NavigationObserver.NavigationEventCleanUpCount"
units="NavigationEvents" expires_after="2021-01-27">
<owner>drubery@chromium.org</owner>
......
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