| Index: net/http/http_cache_transaction.cc
|
| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
|
| index 1b3b9f4d8f71da2c56b9c1c0f5103a106048f0ce..04a0109f09db338af704b3c2d1151b13f3ee745e 100644
|
| --- a/net/http/http_cache_transaction.cc
|
| +++ b/net/http/http_cache_transaction.cc
|
| @@ -2199,6 +2199,9 @@ ValidationType HttpCache::Transaction::RequiresValidation() {
|
| } else {
|
| validation_cause_ = VALIDATION_CAUSE_STALE;
|
| stale_entry_freshness_ = lifetimes.freshness;
|
| + stale_entry_age_ = response_.headers->GetCurrentAge(
|
| + response_.request_time, response_.response_time,
|
| + cache_->clock_->Now());
|
| }
|
| }
|
|
|
| @@ -2742,6 +2745,25 @@ void HttpCache::Transaction::RecordHistograms() {
|
|
|
| UMA_HISTOGRAM_COUNTS("HttpCache.StaleEntry.FreshnessPeriodsSinceLastUsed",
|
| freshness_periods_since_last_used);
|
| +
|
| + if (validation_request) {
|
| + int64_t age_in_freshness_periods =
|
| + (stale_entry_age_ * 100) / stale_entry_freshness_;
|
| + if (transaction_pattern_ == PATTERN_ENTRY_VALIDATED) {
|
| + UMA_HISTOGRAM_COUNTS("HttpCache.StaleEntry.Validated.Age",
|
| + stale_entry_age_.InSeconds());
|
| + UMA_HISTOGRAM_COUNTS(
|
| + "HttpCache.StaleEntry.Validated.AgeInFreshnessPeriods",
|
| + age_in_freshness_periods);
|
| +
|
| + } else {
|
| + UMA_HISTOGRAM_COUNTS("HttpCache.StaleEntry.Updated.Age",
|
| + stale_entry_age_.InSeconds());
|
| + UMA_HISTOGRAM_COUNTS(
|
| + "HttpCache.StaleEntry.Updated.AgeInFreshnessPeriods",
|
| + age_in_freshness_periods);
|
| + }
|
| + }
|
| }
|
|
|
| std::string mime_type;
|
| @@ -2856,8 +2878,8 @@ void HttpCache::Transaction::RecordHistograms() {
|
| }
|
| }
|
|
|
| - UMA_HISTOGRAM_ENUMERATION(
|
| - "HttpCache.Pattern", transaction_pattern_, PATTERN_MAX);
|
| + UMA_HISTOGRAM_ENUMERATION("HttpCache.Pattern", transaction_pattern_,
|
| + PATTERN_MAX);
|
|
|
| if (validation_request) {
|
| UMA_HISTOGRAM_ENUMERATION("HttpCache.ValidationCause", validation_cause_,
|
|
|