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

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

Issue 10900037: Adding more histograms to ResourcePrefetchPredictor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ResourcePrefetchPredictor can only be enabled at startup. Created 8 years, 4 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
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 24964987874176ae493723e8d522373009f27a5e..4744f96952da121a11ceeeb2592b103e0aa9a067 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -82,8 +82,6 @@ class ResourcePrefetchPredictor
int max_resources_per_entry; // Default 50
// The number of consecutive misses after we stop tracking a resource Url.
int max_consecutive_misses; // Default 3
- // The number of resources we should report accuracy stats on.
- int num_resources_assumed_prefetched; // Default 25
};
// Stores the data that we need to get from the URLRequest.
@@ -106,7 +104,7 @@ class ResourcePrefetchPredictor
virtual ~ResourcePrefetchPredictor();
// Thread safe.
- static bool IsEnabled(Profile* profile);
+ static bool IsEnabled();
static bool ShouldRecordRequest(net::URLRequest* request,
ResourceType::Type resource_type);
static bool ShouldRecordResponse(net::URLRequest* response);
@@ -196,6 +194,10 @@ class ResourcePrefetchPredictor
void LearnUrlNavigation(const GURL& main_frame_url,
const std::vector<URLRequestSummary>& new_value);
void MaybeReportAccuracyStats(const NavigationID& navigation_id) const;
+ void ReportAccuracyHistograms(const UrlTableRowVector& predicted,
+ const std::map<GURL, bool>& actual_resources,
+ int total_resources_fetched_from_network,
+ int max_assumed_prefetched) const;
void SetTablesForTesting(
scoped_refptr<ResourcePrefetchPredictorTables> tables);

Powered by Google App Engine
This is Rietveld 408576698