Commit 58011593 authored by rtenneti@chromium.org's avatar rtenneti@chromium.org

QUIC - histograms to measure the time spent to read QUIC sever

information from disk cache.

R=rch@chromium.org

Review URL: https://codereview.chromium.org/189963002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255887 0039d316-1c4b-4281-b951-d872f2087c98
parent 4c51da13
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "net/quic/quic_crypto_client_stream.h" #include "net/quic/quic_crypto_client_stream.h"
#include "base/metrics/histogram.h"
#include "net/base/completion_callback.h" #include "net/base/completion_callback.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "net/quic/crypto/crypto_protocol.h" #include "net/quic/crypto/crypto_protocol.h"
...@@ -422,13 +423,16 @@ int QuicCryptoClientStream::DoLoadQuicServerInfo( ...@@ -422,13 +423,16 @@ int QuicCryptoClientStream::DoLoadQuicServerInfo(
return OK; return OK;
} }
read_start_time_ = base::TimeTicks::Now();
generation_counter_ = cached->generation_counter(); generation_counter_ = cached->generation_counter();
next_state_ = STATE_LOAD_QUIC_SERVER_INFO_COMPLETE; next_state_ = STATE_LOAD_QUIC_SERVER_INFO_COMPLETE;
// TODO(rtenneti): If multiple tabs load the same URL, all requests except for // TODO(rtenneti): Use host:port to access QUIC server information from disk
// the first request send InchoateClientHello. Fix the code to handle multiple // cache. If multiple tabs load URLs with same hostname but different
// requests. A possible solution is to wait for the first request to finish // ports, all requests except for the first request send InchoateClientHello.
// and use the data from the disk cache for all requests. // Fix the code to handle multiple requests. A possible solution is to wait
// for the first request to finish and use the data from the disk cache for
// all requests.
// We may need to call quic_server_info->Persist later. // We may need to call quic_server_info->Persist later.
// quic_server_info->Persist requires quic_server_info to be ready, so we // quic_server_info->Persist requires quic_server_info to be ready, so we
// always call WaitForDataReady, even though we might have initialized // always call WaitForDataReady, even though we might have initialized
...@@ -461,6 +465,9 @@ void QuicCryptoClientStream::LoadQuicServerInfo( ...@@ -461,6 +465,9 @@ void QuicCryptoClientStream::LoadQuicServerInfo(
return; return;
} }
UMA_HISTOGRAM_TIMES("Net.QuicServerInfo.DiskCacheReadTime",
base::TimeTicks::Now() - read_start_time_);
if (disk_cache_load_result_ != OK || !cached->LoadQuicServerInfo( if (disk_cache_load_result_ != OK || !cached->LoadQuicServerInfo(
session()->connection()->clock()->WallNow())) { session()->connection()->clock()->WallNow())) {
// It is ok to proceed to STATE_SEND_CHLO when we cannot load QuicServerInfo // It is ok to proceed to STATE_SEND_CHLO when we cannot load QuicServerInfo
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "net/cert/cert_verify_result.h" #include "net/cert/cert_verify_result.h"
#include "net/cert/x509_certificate.h" #include "net/cert/x509_certificate.h"
#include "net/quic/crypto/proof_verifier.h" #include "net/quic/crypto/proof_verifier.h"
...@@ -135,6 +136,10 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { ...@@ -135,6 +136,10 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream {
// It must not be used after STATE_LOAD_QUIC_SERVER_INFO_COMPLETE. // It must not be used after STATE_LOAD_QUIC_SERVER_INFO_COMPLETE.
int disk_cache_load_result_; int disk_cache_load_result_;
// Time when call to WaitForDataReady was made, used for computing time spent
// to read QUIC server information from disk cache.
base::TimeTicks read_start_time_;
base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_; base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream);
......
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