Commit 7dad1c44 authored by Lily Chen's avatar Lily Chen Committed by Commit Bot

Add a histogram to track HTTP auth cache size

This change adds a histogram that tracks the number of cache entries
examined when no matching entry is found (which is most of the time).
This will allow us to have a better proxy for HTTP auth cache size.

Bug: 757116
Change-Id: I8a4b7348a473d2802ac12dda2589569e523b3e5e
Reviewed-on: https://chromium-review.googlesource.com/c/1265435Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597314}
parent 27c866c0
...@@ -68,6 +68,11 @@ void RecordLookupByPathPosition(int position) { ...@@ -68,6 +68,11 @@ void RecordLookupByPathPosition(int position) {
UMA_HISTOGRAM_COUNTS_100("Net.HttpAuthCacheLookupByPathPosition", position); UMA_HISTOGRAM_COUNTS_100("Net.HttpAuthCacheLookupByPathPosition", position);
} }
void RecordEntriesExaminedWhenNoMatch(int num_examined_entries) {
UMA_HISTOGRAM_COUNTS_100("Net.HttpAuthCacheEntriesExaminedWhenNoMatch",
num_examined_entries);
}
} // namespace } // namespace
namespace net { namespace net {
...@@ -94,6 +99,7 @@ HttpAuthCache::Entry* HttpAuthCache::Lookup(const GURL& origin, ...@@ -94,6 +99,7 @@ HttpAuthCache::Entry* HttpAuthCache::Lookup(const GURL& origin,
} }
} }
RecordLookupPosition(0); RecordLookupPosition(0);
RecordEntriesExaminedWhenNoMatch(entries_examined);
return NULL; // No realm entry found. return NULL; // No realm entry found.
} }
...@@ -128,6 +134,8 @@ HttpAuthCache::Entry* HttpAuthCache::LookupByPath(const GURL& origin, ...@@ -128,6 +134,8 @@ HttpAuthCache::Entry* HttpAuthCache::LookupByPath(const GURL& origin,
} }
if (best_match) if (best_match)
best_match->last_use_time_ticks_ = tick_clock_->NowTicks(); best_match->last_use_time_ticks_ = tick_clock_->NowTicks();
else
RecordEntriesExaminedWhenNoMatch(entries_examined);
RecordLookupByPathPosition(best_match_position); RecordLookupByPathPosition(best_match_position);
return best_match; return best_match;
} }
......
...@@ -54324,6 +54324,17 @@ uploading your change for review. ...@@ -54324,6 +54324,17 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.HttpAuthCacheEntriesExaminedWhenNoMatch">
<owner>chlily@chromium.org</owner>
<summary>
The number of entries examined (equal to the cache size) when attempting to
look up an HTTP auth cache entry (either by path or realm) and finding no
matching entries. This is recorded whenever the lookup fails (i.e., value 0
in Net.HttpAuthCacheLookupPosition and
Net.HttpAuthCacheLookupByPathPosition).
</summary>
</histogram>
<histogram name="Net.HttpAuthCacheLookupByPathPosition"> <histogram name="Net.HttpAuthCacheLookupByPathPosition">
<owner>asanka@chromium.org</owner> <owner>asanka@chromium.org</owner>
<summary> <summary>
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