Index: net/http/http_cache_transaction.h |
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h |
index 5b1dc6c5eaa9a7b747aa913a9065ec797038cd2b..c4270f847e0ad6da8ee0d528c96e2e175d1ff2f9 100644 |
--- a/net/http/http_cache_transaction.h |
+++ b/net/http/http_cache_transaction.h |
@@ -174,6 +174,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); |
@@ -334,6 +347,11 @@ class HttpCache::Transaction : public HttpTransaction { |
// Called to signal completion of asynchronous IO. |
void OnIOComplete(int result); |
+ void UpdateTransactionPattern(TransactionPattern transaction_pattern); |
+ |
+ // Called on completion of a request to record performance. |
+ void RecordHistograms(); |
+ |
State next_state_; |
const HttpRequestInfo* request_; |
BoundNetLog net_log_; |
@@ -344,7 +362,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. |
@@ -371,6 +388,14 @@ 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 open_entry_since_; |
+ base::TimeTicks send_request_since_; |
}; |
} // namespace net |