Commit 64f6cbf8 authored by Alexandr Ilin's avatar Alexandr Ilin Committed by Commit Bot

predictors: Stop reporting several ResourcePrefetchPredictor histograms

The data collected for the following histograms have not been used recently:
- ResourcePrefetchPredictor.PrefetchingDuration
- ResourcePrefetchPredictor.ReportingEvent

Bug: 900064
Change-Id: I4f1d6b479c1a5a1f1a5c30160322acd436fcbc8c
Reviewed-on: https://chromium-review.googlesource.com/c/1343091Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610199}
parent 0377e72d
...@@ -91,12 +91,12 @@ void LoadingPredictor::PrepareForPageLoad(const GURL& url, ...@@ -91,12 +91,12 @@ void LoadingPredictor::PrepareForPageLoad(const GURL& url,
has_preconnect_prediction = has_preconnect_prediction =
AddInitialUrlToPreconnectPrediction(url, &prediction); AddInitialUrlToPreconnectPrediction(url, &prediction);
if (has_preconnect_prediction) { if (!has_preconnect_prediction)
// To report hint durations and deduplicate hints to the same url. return;
active_hints_.emplace(url, base::TimeTicks::Now()); active_hints_.emplace(url, base::TimeTicks::Now());
if (IsPreconnectAllowed(profile_)) if (IsPreconnectAllowed(profile_))
MaybeAddPreconnect(url, std::move(prediction.requests), origin); MaybeAddPreconnect(url, std::move(prediction.requests), origin);
}
} }
void LoadingPredictor::CancelPageLoadHint(const GURL& url) { void LoadingPredictor::CancelPageLoadHint(const GURL& url) {
...@@ -169,9 +169,6 @@ std::map<GURL, base::TimeTicks>::iterator LoadingPredictor::CancelActiveHint( ...@@ -169,9 +169,6 @@ std::map<GURL, base::TimeTicks>::iterator LoadingPredictor::CancelActiveHint(
const GURL& url = hint_it->first; const GURL& url = hint_it->first;
MaybeRemovePreconnect(url); MaybeRemovePreconnect(url);
UMA_HISTOGRAM_TIMES(
internal::kResourcePrefetchPredictorPrefetchingDurationHistogram,
base::TimeTicks::Now() - hint_it->second);
return active_hints_.erase(hint_it); return active_hints_.erase(hint_it);
} }
......
...@@ -145,38 +145,6 @@ void LoadingPredictorPreconnectTest::SetPreference() { ...@@ -145,38 +145,6 @@ void LoadingPredictorPreconnectTest::SetPreference() {
chrome_browser_net::NETWORK_PREDICTION_ALWAYS); chrome_browser_net::NETWORK_PREDICTION_ALWAYS);
} }
TEST_F(LoadingPredictorTest, TestPrefetchingDurationHistogram) {
base::HistogramTester histogram_tester;
const GURL url = GURL(kUrl);
const GURL url2 = GURL(kUrl2);
const GURL url3 = GURL(kUrl3);
predictor_->PrepareForPageLoad(url, HintOrigin::NAVIGATION);
predictor_->CancelPageLoadHint(url);
histogram_tester.ExpectTotalCount(
internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 1);
// Mismatched start / end.
predictor_->PrepareForPageLoad(url, HintOrigin::NAVIGATION);
predictor_->CancelPageLoadHint(url2);
// No increment.
histogram_tester.ExpectTotalCount(
internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 1);
// Can track a navigation (url2) while one is still in progress (url).
predictor_->PrepareForPageLoad(url2, HintOrigin::NAVIGATION);
predictor_->CancelPageLoadHint(url2);
histogram_tester.ExpectTotalCount(
internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 2);
// Do not track non-prefetchable URLs.
predictor_->PrepareForPageLoad(url3, HintOrigin::NAVIGATION);
predictor_->CancelPageLoadHint(url3);
// No increment.
histogram_tester.ExpectTotalCount(
internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 2);
}
TEST_F(LoadingPredictorTest, TestMainFrameResponseCancelsHint) { TEST_F(LoadingPredictorTest, TestMainFrameResponseCancelsHint) {
const GURL url = GURL(kUrl); const GURL url = GURL(kUrl);
predictor_->PrepareForPageLoad(url, HintOrigin::EXTERNAL); predictor_->PrepareForPageLoad(url, HintOrigin::EXTERNAL);
......
...@@ -34,13 +34,6 @@ namespace { ...@@ -34,13 +34,6 @@ namespace {
const float kMinOriginConfidenceToTriggerPreconnect = 0.75f; const float kMinOriginConfidenceToTriggerPreconnect = 0.75f;
const float kMinOriginConfidenceToTriggerPreresolve = 0.2f; const float kMinOriginConfidenceToTriggerPreresolve = 0.2f;
// For reporting events of interest that are not tied to any navigation.
enum ReportingEvent {
REPORTING_EVENT_ALL_HISTORY_CLEARED = 0,
REPORTING_EVENT_PARTIAL_HISTORY_CLEARED = 1,
REPORTING_EVENT_COUNT = 2
};
float ComputeRedirectConfidence(const predictors::RedirectStat& redirect) { float ComputeRedirectConfidence(const predictors::RedirectStat& redirect) {
return (redirect.number_of_hits() + 0.0) / return (redirect.number_of_hits() + 0.0) /
(redirect.number_of_hits() + redirect.number_of_misses()); (redirect.number_of_hits() + redirect.number_of_misses());
...@@ -438,17 +431,10 @@ void ResourcePrefetchPredictor::OnURLsDeleted( ...@@ -438,17 +431,10 @@ void ResourcePrefetchPredictor::OnURLsDeleted(
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(initialization_state_ == INITIALIZED); DCHECK(initialization_state_ == INITIALIZED);
if (deletion_info.IsAllHistory()) { if (deletion_info.IsAllHistory())
DeleteAllUrls(); DeleteAllUrls();
UMA_HISTOGRAM_ENUMERATION("ResourcePrefetchPredictor.ReportingEvent", else
REPORTING_EVENT_ALL_HISTORY_CLEARED,
REPORTING_EVENT_COUNT);
} else {
DeleteUrls(deletion_info.deleted_rows()); DeleteUrls(deletion_info.deleted_rows());
UMA_HISTOGRAM_ENUMERATION("ResourcePrefetchPredictor.ReportingEvent",
REPORTING_EVENT_PARTIAL_HISTORY_CLEARED,
REPORTING_EVENT_COUNT);
}
} }
void ResourcePrefetchPredictor::OnHistoryServiceLoaded( void ResourcePrefetchPredictor::OnHistoryServiceLoaded(
......
...@@ -39,9 +39,6 @@ struct OriginRequestSummary; ...@@ -39,9 +39,6 @@ struct OriginRequestSummary;
struct PageRequestSummary; struct PageRequestSummary;
namespace internal { namespace internal {
constexpr char kResourcePrefetchPredictorPrefetchingDurationHistogram[] =
"ResourcePrefetchPredictor.PrefetchingDuration";
struct LastVisitTimeCompare { struct LastVisitTimeCompare {
template <typename T> template <typename T>
bool operator()(const T& lhs, const T& rhs) const { bool operator()(const T& lhs, const T& rhs) const {
......
...@@ -90743,6 +90743,9 @@ uploading your change for review. ...@@ -90743,6 +90743,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="ResourcePrefetchPredictor.PrefetchingDuration" units="ms"> <histogram name="ResourcePrefetchPredictor.PrefetchingDuration" units="ms">
<obsolete>
Deprecated at M72. No longer recorded.
</obsolete>
<owner>alexilin@chromium.org</owner> <owner>alexilin@chromium.org</owner>
<summary> <summary>
Amount of time available for prefetching. Specifically, this is a time Amount of time available for prefetching. Specifically, this is a time
...@@ -90804,6 +90807,9 @@ uploading your change for review. ...@@ -90804,6 +90807,9 @@ uploading your change for review.
<histogram name="ResourcePrefetchPredictor.ReportingEvent" <histogram name="ResourcePrefetchPredictor.ReportingEvent"
enum="ResourcePrefetchPredictorReportingEvent"> enum="ResourcePrefetchPredictorReportingEvent">
<obsolete>
Deprecated at M72. No longer recorded.
</obsolete>
<owner>alexilin@chromium.org</owner> <owner>alexilin@chromium.org</owner>
<summary> <summary>
Records stats about various interesting events such as - when partial or all Records stats about various interesting events such as - when partial or all
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