diff options
-rw-r--r-- | net/base/load_log_event_type_list.h | 16 | ||||
-rw-r--r-- | net/flip/flip_network_transaction.cc | 17 | ||||
-rw-r--r-- | net/flip/flip_network_transaction.h | 2 | ||||
-rw-r--r-- | net/flip/flip_session.cc | 6 |
4 files changed, 40 insertions, 1 deletions
diff --git a/net/base/load_log_event_type_list.h b/net/base/load_log_event_type_list.h index 96b46c2..eeccfd3 100644 --- a/net/base/load_log_event_type_list.h +++ b/net/base/load_log_event_type_list.h @@ -162,6 +162,22 @@ EVENT_TYPE(HTTP_TRANSACTION_READ_BODY) EVENT_TYPE(HTTP_TRANSACTION_DRAIN_BODY_FOR_AUTH_RESTART) // ------------------------------------------------------------------------ +// FlipNetworkTransaction +// ------------------------------------------------------------------------ + +// Measures the time taken to get a flip stream. +EVENT_TYPE(FLIP_TRANSACTION_INIT_CONNECTION) + +// Measures the time taken to send the request to the server. +EVENT_TYPE(FLIP_TRANSACTION_SEND_REQUEST) + +// Measures the time to read HTTP response headers from the server. +EVENT_TYPE(FLIP_TRANSACTION_READ_HEADERS) + +// Measures the time to read the entity body from the server. +EVENT_TYPE(FLIP_TRANSACTION_READ_BODY) + +// ------------------------------------------------------------------------ // SocketStream // ------------------------------------------------------------------------ diff --git a/net/flip/flip_network_transaction.cc b/net/flip/flip_network_transaction.cc index c8c55d2..f331665 100644 --- a/net/flip/flip_network_transaction.cc +++ b/net/flip/flip_network_transaction.cc @@ -47,6 +47,7 @@ int FlipNetworkTransaction::Start(const HttpRequestInfo* request_info, CHECK(request_info); CHECK(callback); + load_log_ = load_log; request_ = request_info; start_time_ = base::TimeTicks::Now(); @@ -156,30 +157,46 @@ int FlipNetworkTransaction::DoLoop(int result) { switch (state) { case STATE_INIT_CONNECTION: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION); rv = DoInitConnection(); break; case STATE_INIT_CONNECTION_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION); rv = DoInitConnectionComplete(rv); break; case STATE_SEND_REQUEST: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST); rv = DoSendRequest(); break; case STATE_SEND_REQUEST_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST); rv = DoSendRequestComplete(rv); break; case STATE_READ_HEADERS: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS); rv = DoReadHeaders(); break; case STATE_READ_HEADERS_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS); rv = DoReadHeadersComplete(rv); break; case STATE_READ_BODY: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY); rv = DoReadBody(); break; case STATE_READ_BODY_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY); rv = DoReadBodyComplete(rv); break; case STATE_NONE: diff --git a/net/flip/flip_network_transaction.h b/net/flip/flip_network_transaction.h index ae1588d..eab2f45 100644 --- a/net/flip/flip_network_transaction.h +++ b/net/flip/flip_network_transaction.h @@ -87,6 +87,8 @@ class FlipNetworkTransaction : public HttpTransaction { int DoReadBody(); int DoReadBodyComplete(int result); + scoped_refptr<LoadLog> load_log_; + // The Flip session servicing this request. If NULL, the request has not // started. scoped_refptr<FlipSession> flip_; diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index ec2a5f7..d02a506 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -477,7 +477,8 @@ void FlipSession::OnWriteComplete(int result) { write_pending_ = false; - LOG(INFO) << "Flip write complete (result=" << result << ")"; + LOG(INFO) << "Flip write complete (result=" << result << ") for stream: " + << in_flight_write_.stream()->stream_id(); if (result >= 0) { // It should not be possible to have written more bytes than our @@ -827,6 +828,9 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame, return; } + LOG(INFO) << "FLIP SYN_REPLY RESPONSE HEADERS for stream: " << stream_id; + DumpFlipHeaders(*headers); + // We record content declared as being pushed so that we don't // request a duplicate stream which is already scheduled to be // sent to us. |