Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: net/http/http_network_transaction.cc

Issue 100112: Add a histogram to record the dns resolution + tcp connection times. (Closed)
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 3e878ca7929a0445222803aaea40876df7779e29..af8fea8cc61885d644adc1975bd0eeb30d62f39e 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -581,6 +581,8 @@ int HttpNetworkTransaction::DoResolveHost() {
port = request_->url.EffectiveIntPort();
}
+ host_resolution_start_time_ = base::Time::Now();
+
DidStartDnsResolution(host, this);
return resolver_.Resolve(host, port, &addresses_, &io_callback_);
}
@@ -612,7 +614,7 @@ int HttpNetworkTransaction::DoTCPConnectComplete(int result) {
// If we are using a direct SSL connection, then go ahead and establish the
// SSL connection, now. Otherwise, we need to first issue a CONNECT request.
if (result == OK) {
- LogTCPConnectionMetrics();
+ LogTCPConnectedMetrics();
if (using_ssl_ && !using_tunnel_) {
next_state_ = STATE_SSL_CONNECT;
} else {
@@ -969,7 +971,7 @@ int HttpNetworkTransaction::DoDrainBodyForAuthRestartComplete(int result) {
return OK;
}
-void HttpNetworkTransaction::LogTCPConnectionMetrics() const {
+void HttpNetworkTransaction::LogTCPConnectedMetrics() const {
DCHECK(connect_start_time_ != base::Time());
base::TimeDelta connect_duration =
base::Time::Now() - connect_start_time_;
@@ -978,6 +980,16 @@ void HttpNetworkTransaction::LogTCPConnectionMetrics() const {
"Net.TCP_Connection_Latency", "DnsImpact").data(), connect_duration,
base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
100);
+
+ base::TimeDelta host_resolution_and_tcp_connection_latency =
+ base::Time::Now() - host_resolution_start_time_;
+
+ UMA_HISTOGRAM_CLIPPED_TIMES(
+ FieldTrial::MakeName(
+ "Net.Dns_Resolution_And_TCP_Connection_Latency", "DnsImpact").data(),
+ host_resolution_and_tcp_connection_latency,
+ base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(10),
+ 100);
}
void HttpNetworkTransaction::LogTransactionConnectedMetrics() const {
« no previous file with comments | « net/http/http_network_transaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698