OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 ssl_socket_->IgnoreCertError(result, params_->load_flags())) { | 322 ssl_socket_->IgnoreCertError(result, params_->load_flags())) { |
323 DCHECK(ssl_connect_start_time_ != base::TimeTicks()); | 323 DCHECK(ssl_connect_start_time_ != base::TimeTicks()); |
324 base::TimeDelta connect_duration = | 324 base::TimeDelta connect_duration = |
325 base::TimeTicks::Now() - ssl_connect_start_time_; | 325 base::TimeTicks::Now() - ssl_connect_start_time_; |
326 if (using_spdy) { | 326 if (using_spdy) { |
327 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency", | 327 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency", |
328 connect_duration, | 328 connect_duration, |
329 base::TimeDelta::FromMilliseconds(1), | 329 base::TimeDelta::FromMilliseconds(1), |
330 base::TimeDelta::FromMinutes(10), | 330 base::TimeDelta::FromMinutes(10), |
331 100); | 331 100); |
332 } else { | 332 } |
333 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency", | 333 |
| 334 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency", |
| 335 connect_duration, |
| 336 base::TimeDelta::FromMilliseconds(1), |
| 337 base::TimeDelta::FromMinutes(10), |
| 338 100); |
| 339 |
| 340 const std::string& host = params_->host_and_port().host(); |
| 341 bool is_google = host == "google.com" || |
| 342 (host.size() > 11 && |
| 343 host.rfind(".google.com") == host.size() - 11); |
| 344 if (is_google) { |
| 345 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google", |
334 connect_duration, | 346 connect_duration, |
335 base::TimeDelta::FromMilliseconds(1), | 347 base::TimeDelta::FromMilliseconds(1), |
336 base::TimeDelta::FromMinutes(10), | 348 base::TimeDelta::FromMinutes(10), |
337 100); | 349 100); |
338 | 350 |
339 const std::string& host = params_->host_and_port().host(); | 351 base::FieldTrial* trial = base::FieldTrialList::Find("RevCheckingImpact"); |
340 bool is_google = host == "google.com" || | 352 if (trial) { |
341 (host.size() > 11 && | 353 std::string histogram_name; |
342 host.rfind(".google.com") == host.size() - 11); | 354 if (trial->group() != base::FieldTrial::kDefaultGroupNumber || |
343 if (is_google) { | 355 !params_->ssl_config().rev_checking_enabled) { |
344 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google", | 356 histogram_name = |
| 357 "Net.SSL_Connection_Latency_Google_No_Revocation_Checking"; |
| 358 } else { |
| 359 histogram_name = |
| 360 "Net.SSL_Connection_Latency_Google_Revocation_Checking"; |
| 361 } |
| 362 |
| 363 UMA_HISTOGRAM_CUSTOM_TIMES(histogram_name, |
345 connect_duration, | 364 connect_duration, |
346 base::TimeDelta::FromMilliseconds(1), | 365 base::TimeDelta::FromMilliseconds(1), |
347 base::TimeDelta::FromMinutes(10), | 366 base::TimeDelta::FromMinutes(10), |
348 100); | 367 100); |
349 } | 368 } |
350 } | 369 } |
351 } | 370 } |
352 | 371 |
353 if (result == OK || IsCertificateError(result)) { | 372 if (result == OK || IsCertificateError(result)) { |
354 set_socket(ssl_socket_.release()); | 373 set_socket(ssl_socket_.release()); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 580 |
562 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const { | 581 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const { |
563 return base_.histograms(); | 582 return base_.histograms(); |
564 } | 583 } |
565 | 584 |
566 void SSLClientSocketPool::OnSSLConfigChanged() { | 585 void SSLClientSocketPool::OnSSLConfigChanged() { |
567 Flush(); | 586 Flush(); |
568 } | 587 } |
569 | 588 |
570 } // namespace net | 589 } // namespace net |
OLD | NEW |