Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.h

Issue 2683633004: predictors: Add subresources count and prefetching duration histograms. (Closed)
Patch Set: Nits. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetch_predictor.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index 5bfc2bc4d502b698076f17c5160745a061895500..2af4be9e829da7e1e714545027667493b7ffbab3 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -43,6 +43,10 @@ constexpr char kResourcePrefetchPredictorPrecisionHistogram[] =
"ResourcePrefetchPredictor.LearningPrecision";
constexpr char kResourcePrefetchPredictorRecallHistogram[] =
"ResourcePrefetchPredictor.LearningRecall";
+constexpr char kResourcePrefetchPredictorCountHistogram[] =
+ "ResourcePrefetchPredictor.LearningCount";
+constexpr char kResourcePrefetchPredictorPrefetchingDurationHistogram[] =
+ "ResourcePrefetchPredictor.PrefetchingDuration";
} // namespace internal
class TestObserver;
@@ -210,6 +214,8 @@ class ResourcePrefetchPredictor
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetPrefetchData);
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
TestPrecisionRecallHistograms);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
+ TestPrefetchingDurationHistogram);
enum InitializationState {
NOT_INITIALIZED = 0,
@@ -283,7 +289,7 @@ class ResourcePrefetchPredictor
void OnHistoryAndCacheLoaded();
// Removes data for navigations where the onload never fired. Will cleanup
- // inflight_navigations_.
+ // inflight_navigations_ and inflight_prefetches_.
void CleanupAbandonedNavigations(const NavigationID& navigation_id);
// Deletes all URLs from the predictor database, the caches and removes all
@@ -364,6 +370,7 @@ class ResourcePrefetchPredictor
std::unique_ptr<RedirectDataMap> url_redirect_table_cache_;
std::unique_ptr<RedirectDataMap> host_redirect_table_cache_;
+ std::map<GURL, base::TimeTicks> inflight_prefetches_;
NavigationMap inflight_navigations_;
ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698