diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 17:45:07 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 17:45:07 +0000 |
commit | 028b85aedee66ad252a935d4c15c0a70f804b4b4 (patch) | |
tree | 7f27d7a64d1a0d2182935c5c7e0d1c439b361637 /net | |
parent | 3161a3d39abf9124d390636c1eb42192309bf1d0 (diff) | |
download | chromium_src-028b85aedee66ad252a935d4c15c0a70f804b4b4.zip chromium_src-028b85aedee66ad252a935d4c15c0a70f804b4b4.tar.gz chromium_src-028b85aedee66ad252a935d4c15c0a70f804b4b4.tar.bz2 |
Add histograms for the duration of OCSP and CRL fetches.
NSS (which is the default SSL library on all platforms now) has a set
of callbacks via which it fetches OCSP responsese and CRLs. This patch
adds histograms so that we can measure the amount of time spent in
these operations. (Note that these operations block SSL handshakes).
http://codereview.chromium.org/2834030/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index fa08801..6f8f1c3 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -15,6 +15,7 @@ #include "base/compiler_specific.h" #include "base/condition_variable.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/singleton.h" @@ -598,6 +599,8 @@ SECStatus OCSPTrySendAndReceive(SEC_HTTP_REQUEST_SESSION request, const char** http_response_headers, const char** http_response_data, PRUint32* http_response_data_len) { + base::Time start_time, end_time; + LOG(INFO) << "OCSP try send and receive"; DCHECK(!MessageLoop::current()); OCSPRequestSession* req = reinterpret_cast<OCSPRequestSession*>(request); @@ -611,9 +614,18 @@ SECStatus OCSPTrySendAndReceive(SEC_HTTP_REQUEST_SESSION request, NOTREACHED(); goto failed; } + + start_time = base::Time::Now(); req->Start(); if (!req->Wait()) goto failed; + end_time = base::Time::Now(); + + if (req->http_request_method() == "POST") { + UMA_HISTOGRAM_TIMES("Net.OCSPRequestTimeMs", end_time - start_time); + } else if (req->http_request_method() == "GET") { + UMA_HISTOGRAM_TIMES("Net.CRLRequestTimeMs", end_time - start_time); + } // If the response code is -1, the request failed and there is no response. if (req->http_response_code() == static_cast<PRUint16>(-1)) |