summaryrefslogtreecommitdiffstats
path: root/net/dns
diff options
context:
space:
mode:
authormef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 12:02:55 +0000
committermef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-20 12:02:55 +0000
commitd4a26dbaae765ca898ded3b2f6f2320e1e42491b (patch)
treeee081224657fd08a2d6cee99658815748e8f4510 /net/dns
parent7ec1b48884ef6f7043a444d4ee64d156b2066fe2 (diff)
downloadchromium_src-d4a26dbaae765ca898ded3b2f6f2320e1e42491b.zip
chromium_src-d4a26dbaae765ca898ded3b2f6f2320e1e42491b.tar.gz
chromium_src-d4a26dbaae765ca898ded3b2f6f2320e1e42491b.tar.bz2
Histogram count of DnsAttempts before DnsTransaction completes successfully or with failure.
BUG=110197 Review URL: https://chromiumcodereview.appspot.com/19849002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns')
-rw-r--r--net/dns/dns_transaction.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index e5afdf1..170ea67 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -528,6 +528,7 @@ class DnsTransactionImpl : public DnsTransaction,
callback_(callback),
net_log_(net_log),
qnames_initial_size_(0),
+ attempts_count_(0),
had_tcp_attempt_(false),
first_server_index_(0) {
DCHECK(session_.get());
@@ -641,6 +642,10 @@ class DnsTransactionImpl : public DnsTransaction,
timer_.Stop();
RecordLostPacketsIfAny();
+ if (result.rv == OK)
+ UMA_HISTOGRAM_COUNTS("AsyncDNS.AttemptCountSuccess", attempts_count_);
+ else
+ UMA_HISTOGRAM_COUNTS("AsyncDNS.AttemptCountFail", attempts_count_);
if (response && qtype_ == dns_protocol::kTypeA) {
UMA_HISTOGRAM_COUNTS("AsyncDNS.SuffixSearchRemain", qnames_.size());
@@ -684,6 +689,7 @@ class DnsTransactionImpl : public DnsTransaction,
new DnsUDPAttempt(server_index, lease.Pass(), query.Pass());
attempts_.push_back(attempt);
+ ++attempts_count_;
if (!got_socket)
return AttemptResult(ERR_CONNECTION_REFUSED, NULL);
@@ -728,6 +734,7 @@ class DnsTransactionImpl : public DnsTransaction,
query.Pass());
attempts_.push_back(attempt);
+ ++attempts_count_;
had_tcp_attempt_ = true;
net_log_.AddEvent(
@@ -909,6 +916,8 @@ class DnsTransactionImpl : public DnsTransaction,
// List of attempts for the current name.
ScopedVector<DnsAttempt> attempts_;
+ // Count of attempts, not reset when |attempts_| vector is cleared.
+ int attempts_count_;
bool had_tcp_attempt_;
// Index of the first server to try on each search query.