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

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: catch more special cases Created 8 years, 5 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 | net/http/http_cache_transaction.cc » ('j') | net/http/http_cache_transaction.cc » ('J')
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 5b1dc6c5eaa9a7b747aa913a9065ec797038cd2b..e27a75874b404513bc3446b20d53c0295285f4fa 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 reporting times in histograms. The dispositions cover relatively
+ // common simple cases for cache resource requests, but are not intended to be
+ // exhaustive; many tricky special cases are all binned together as
+ // DISPOSITION_DO_NOT_RECORD.
+ enum Disposition {
+ DISPOSITION_UNDEFINED,
+ DISPOSITION_DO_NOT_RECORD,
+ DISPOSITION_NO_ENTRY,
+ DISPOSITION_ENTRY_UNCONDITIONALLY_USED,
+ DISPOSITION_ENTRY_VALIDATED_304,
+ DISPOSITION_ENTRY_VALIDATED_200,
+ };
+
// 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,12 @@ class HttpCache::Transaction : public HttpTransaction {
// Called to signal completion of asynchronous IO.
void OnIOComplete(int result);
+ // Called when we've determined the disposition of this request.
+ void MaybeUpdateDisposition(Disposition disposition);
+
+ // Called on completion of a request to record performance.
+ void RecordHistograms(int resource_size);
+
State next_state_;
const HttpRequestInfo* request_;
BoundNetLog net_log_;
@@ -344,7 +363,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 +389,12 @@ class HttpCache::Transaction : public HttpTransaction {
uint64 final_upload_progress_;
base::WeakPtrFactory<Transaction> weak_factory_;
CompletionCallback io_callback_;
+
+ // Members used to track data for histograms.
+ Disposition disposition_;
+ base::TimeTicks entry_lock_waiting_since_;
+ base::TimeTicks open_entry_since_;
+ base::TimeTicks started_reading_since_;
};
} // namespace net
« no previous file with comments | « no previous file | net/http/http_cache_transaction.cc » ('j') | net/http/http_cache_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698