Commit 96b7a82c authored by zhongyi's avatar zhongyi Committed by Commit bot

Create a separate NetLog source type QUIC_STREAM_FACTORY_JOB

for each QuicStreamFactory::Job created.

BUG=702411

Review-Url: https://codereview.chromium.org/2800023002
Cr-Commit-Position: refs/heads/master@{#463023}
parent 45739334
...@@ -1094,6 +1094,15 @@ EVENT_TYPE(HTTP_STREAM_JOB_INIT_CONNECTION) ...@@ -1094,6 +1094,15 @@ EVENT_TYPE(HTTP_STREAM_JOB_INIT_CONNECTION)
// } // }
EVENT_TYPE(HTTP_STREAM_REQUEST_BOUND_TO_JOB) EVENT_TYPE(HTTP_STREAM_REQUEST_BOUND_TO_JOB)
// Identifies the NetLogSource() for the QuicStreamFactory::Job that the
// HttpStreamFactoryImpl::Job was attached to.
// The event parameters are:
// {
// "source_dependency": <Source identifier for the QuicStreamFactory::Job
// to which we were attached>,
// }
EVENT_TYPE(HTTP_STREAM_JOB_BOUND_TO_QUIC_STREAM_FACTORY_JOB)
// Identifies the NetLogSource() for the Request that the Job was attached to. // Identifies the NetLogSource() for the Request that the Job was attached to.
// The event parameters are: // The event parameters are:
// { // {
...@@ -1631,6 +1640,27 @@ EVENT_TYPE(HTTP2_PROXY_CLIENT_SESSION) ...@@ -1631,6 +1640,27 @@ EVENT_TYPE(HTTP2_PROXY_CLIENT_SESSION)
// "source_dependency": <Source identifier for the underlying session>, // "source_dependency": <Source identifier for the underlying session>,
// } // }
// ------------------------------------------------------------------------
// QuicStreamFactory::Job
// ------------------------------------------------------------------------
// Measures the time taken to execute the QuicStreamFactory::Job.
// The event parameters are:
// {
// "server_id": <The QuicServerId that the Job serves>,
// }
EVENT_TYPE(QUIC_STREAM_FACTORY_JOB)
// Identifies the NetLogSource() for the HttpStreamFactoryImpl::Job that the
// Job was attached to.
// The event parameters are:
// {
// "source_dependency": <Source identifier for the
// HttpStreamFactoryImpl::Job to which we were
// attached>,
// }
EVENT_TYPE(QUIC_STREAM_FACTORY_JOB_BOUND_TO_HTTP_STREAM_JOB)
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// QuicSession // QuicSession
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -40,3 +40,4 @@ SOURCE_TYPE(NETWORK_QUALITY_ESTIMATOR) ...@@ -40,3 +40,4 @@ SOURCE_TYPE(NETWORK_QUALITY_ESTIMATOR)
SOURCE_TYPE(HTTP_STREAM_JOB_CONTROLLER) SOURCE_TYPE(HTTP_STREAM_JOB_CONTROLLER)
SOURCE_TYPE(CT_TREE_STATE_TRACKER) SOURCE_TYPE(CT_TREE_STATE_TRACKER)
SOURCE_TYPE(SERVER_PUSH_LOOKUP_TRANSACTION) SOURCE_TYPE(SERVER_PUSH_LOOKUP_TRANSACTION)
SOURCE_TYPE(QUIC_STREAM_FACTORY_JOB)
...@@ -92,6 +92,14 @@ const int32_t kQuicStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB ...@@ -92,6 +92,14 @@ const int32_t kQuicStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
// Set the maximum number of undecryptable packets the connection will store. // Set the maximum number of undecryptable packets the connection will store.
const int32_t kMaxUndecryptablePackets = 100; const int32_t kMaxUndecryptablePackets = 100;
std::unique_ptr<base::Value> NetLogQuicStreamFactoryJobCallback(
const QuicServerId* server_id,
NetLogCaptureMode capture_mode) {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("server_id", server_id->ToString());
return std::move(dict);
}
std::unique_ptr<base::Value> NetLogQuicConnectionMigrationTriggerCallback( std::unique_ptr<base::Value> NetLogQuicConnectionMigrationTriggerCallback(
std::string trigger, std::string trigger,
NetLogCaptureMode capture_mode) { NetLogCaptureMode capture_mode) {
...@@ -386,12 +394,26 @@ QuicStreamFactory::Job::Job(QuicStreamFactory* factory, ...@@ -386,12 +394,26 @@ QuicStreamFactory::Job::Job(QuicStreamFactory* factory,
was_alternative_service_recently_broken), was_alternative_service_recently_broken),
server_info_(std::move(server_info)), server_info_(std::move(server_info)),
started_another_job_(false), started_another_job_(false),
net_log_(net_log), net_log_(
NetLogWithSource::Make(net_log.net_log(),
NetLogSourceType::QUIC_STREAM_FACTORY_JOB)),
num_sent_client_hellos_(0), num_sent_client_hellos_(0),
session_(nullptr), session_(nullptr),
weak_factory_(this) {} weak_factory_(this) {
net_log_.BeginEvent(
NetLogEventType::QUIC_STREAM_FACTORY_JOB,
base::Bind(&NetLogQuicStreamFactoryJobCallback, &key_.server_id()));
// Associate |net_log_| with |net_log|.
net_log_.AddEvent(
NetLogEventType::QUIC_STREAM_FACTORY_JOB_BOUND_TO_HTTP_STREAM_JOB,
net_log.source().ToEventParametersCallback());
net_log.AddEvent(
NetLogEventType::HTTP_STREAM_JOB_BOUND_TO_QUIC_STREAM_FACTORY_JOB,
net_log_.source().ToEventParametersCallback());
}
QuicStreamFactory::Job::~Job() { QuicStreamFactory::Job::~Job() {
net_log_.EndEvent(NetLogEventType::QUIC_STREAM_FACTORY_JOB);
DCHECK(callback_.is_null()); DCHECK(callback_.is_null());
// If disk cache has a pending WaitForDataReadyCallback, cancel that callback. // If disk cache has a pending WaitForDataReadyCallback, cancel that callback.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment