Skip to content

Commit

Permalink
[page_load_metrics] Log ParseDuration variants based on % cached subr…
Browse files Browse the repository at this point in the history
…esources

This patch uses the experimental page_load_metrics infrastructure which
calculates % of cached subresources to separate out warm/cold cache page
loads.

BUG=

Review-Url: https://codereview.chromium.org/2240553002
Cr-Commit-Position: refs/heads/master@{#411392}
  • Loading branch information
csharrison authored and Commit bot committed Aug 11, 2016
1 parent a83f2f3 commit 9cae2a0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,24 @@ void CorePageLoadMetricsObserver::OnParseStop(

int total_requests = info.num_cache_requests + info.num_network_requests;
if (total_requests) {
UMA_HISTOGRAM_PERCENTAGE(
internal::kHistogramCacheRequestPercentParseStop,
(100 * info.num_cache_requests) / total_requests);
int percent_cached = (100 * info.num_cache_requests) / total_requests;
UMA_HISTOGRAM_PERCENTAGE(internal::kHistogramCacheRequestPercentParseStop,
percent_cached);
UMA_HISTOGRAM_COUNTS(internal::kHistogramCacheTotalRequestsParseStop,
info.num_cache_requests);
UMA_HISTOGRAM_COUNTS(internal::kHistogramTotalRequestsParseStop,
info.num_cache_requests + info.num_network_requests);

// Separate out parse duration based on cache percent.
if (percent_cached <= 50) {
PAGE_LOAD_HISTOGRAM(
"PageLoad.Experimental.ParseDuration.CachedPercent.0-50",
parse_duration);
} else {
PAGE_LOAD_HISTOGRAM(
"PageLoad.Experimental.ParseDuration.CachedPercent.51-100",
parse_duration);
}
}

} else {
Expand Down
18 changes: 18 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38124,6 +38124,24 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>

<histogram name="PageLoad.Experimental.ParseDuration.CachePercent.0-50"
units="ms">
<owner>csharrison@chromium.org</owner>
<summary>
The parse duration of the page load where 0-50% of all subresources (loaded
during parsing) were served from the HTTP cache (including 304s).
</summary>
</histogram>

<histogram name="PageLoad.Experimental.ParseDuration.CachePercent.51-100"
units="ms">
<owner>csharrison@chromium.org</owner>
<summary>
The parse duration of the page load where 51-100% of all subresources
(loaded during parsing) were served from the HTTP cache (including 304s).
</summary>
</histogram>

<histogram name="PageLoad.Experimental.TotalRequests.ParseStop"
units="requests">
<owner>csharrison@chromium.org</owner>
Expand Down

0 comments on commit 9cae2a0

Please sign in to comment.