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

Unified Diff: net/http/http_cache_transaction.h

Issue 10808047: Add HttpCache histograms focussed on blocking and transaction type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... how about a fix that compiles. 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
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.h
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index 991c5ad3086ffbc9aea600a73122877523254aab..e37949e99abc8053321550f1c66a44dbd73dbe58 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -175,6 +175,19 @@ class HttpCache::Transaction : public HttpTransaction {
STATE_CACHE_WRITE_DATA_COMPLETE
};
+ // Used for categorizing transactions for reporting in histograms. Patterns
+ // cover relatively common use cases being measured and considered for
+ // optimization. Many use cases that are more complex or uncommon are binned
+ // as PATTERN_NOT_COVERED, and details are not reported.
+ enum TransactionPattern {
+ PATTERN_UNDEFINED,
+ PATTERN_NOT_COVERED,
+ PATTERN_ENTRY_NOT_CACHED,
+ PATTERN_ENTRY_USED,
+ PATTERN_ENTRY_VALIDATED,
+ PATTERN_ENTRY_UPDATED,
+ };
+
// This is a helper function used to trigger a completion callback. It may
// only be called if callback_ is non-null.
void DoCallback(int rv);
@@ -342,6 +355,8 @@ class HttpCache::Transaction : public HttpTransaction {
void ReportCacheActionStart();
void ReportCacheActionFinish();
+ void UpdateTransactionPattern(TransactionPattern new_transaction_pattern);
+ void RecordHistograms();
State next_state_;
const HttpRequestInfo* request_;
@@ -353,7 +368,6 @@ class HttpCache::Transaction : public HttpTransaction {
ValidationHeaders external_validation_;
base::WeakPtr<HttpCache> cache_;
HttpCache::ActiveEntry* entry_;
- base::TimeTicks entry_lock_waiting_since_;
HttpCache::ActiveEntry* new_entry_;
scoped_ptr<HttpTransaction> network_trans_;
CompletionCallback callback_; // Consumer's callback.
@@ -380,6 +394,15 @@ class HttpCache::Transaction : public HttpTransaction {
uint64 final_upload_progress_;
base::WeakPtrFactory<Transaction> weak_factory_;
CompletionCallback io_callback_;
+
+ // Members used to track data for histograms.
+ TransactionPattern transaction_pattern_;
+ int bytes_read_from_cache_;
+ int bytes_read_from_network_;
+ base::TimeTicks entry_lock_waiting_since_;
+ base::TimeTicks first_cache_access_since_;
+ base::TimeTicks send_request_since_;
+
HttpTransactionDelegate* transaction_delegate_;
};
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698