Chromium Code Reviews| Index: net/dns/dns_config_service.cc |
| diff --git a/net/dns/dns_config_service.cc b/net/dns/dns_config_service.cc |
| index bff1fc709f8df5d1b9f1e26f75dccf8e73b97573..fe8386e776d7dee2cbae43cc4cea40899e54464b 100644 |
| --- a/net/dns/dns_config_service.cc |
| +++ b/net/dns/dns_config_service.cc |
| @@ -5,6 +5,7 @@ |
| #include "net/dns/dns_config_service.h" |
| #include "base/logging.h" |
| +#include "base/metrics/histogram.h" |
| #include "base/values.h" |
| #include "net/base/ip_endpoint.h" |
| @@ -104,6 +105,12 @@ void DnsConfigService::Watch(const CallbackType& callback) { |
| void DnsConfigService::InvalidateConfig() { |
| DCHECK(CalledOnValidThread()); |
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (!last_invalidate_config_time_.is_null()) { |
| + UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.ConfigNotifyPeriod", |
|
cbentzel
2012/06/15 20:29:36
ConfigNotifyIntervval perhaps?
szym
2012/06/15 21:22:19
Done.
|
| + now - last_invalidate_config_time_); |
| + } |
| + last_invalidate_config_time_ = now; |
| if (!have_config_) |
| return; |
| have_config_ = false; |
| @@ -112,6 +119,12 @@ void DnsConfigService::InvalidateConfig() { |
| void DnsConfigService::InvalidateHosts() { |
| DCHECK(CalledOnValidThread()); |
| + base::TimeTicks now = base::TimeTicks::Now(); |
| + if (!last_invalidate_hosts_time_.is_null()) { |
| + UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.HostsNotifyPeriod", |
| + now - last_invalidate_hosts_time_); |
| + } |
| + last_invalidate_hosts_time_ = now; |
| if (!have_hosts_) |
| return; |
| have_hosts_ = false; |
| @@ -122,10 +135,13 @@ void DnsConfigService::OnConfigRead(const DnsConfig& config) { |
| DCHECK(CalledOnValidThread()); |
| DCHECK(config.IsValid()); |
| + bool changed = false; |
| if (!config.EqualsIgnoreHosts(dns_config_)) { |
| dns_config_.CopyIgnoreHosts(config); |
| need_update_ = true; |
| + changed = true; |
| } |
| + UMA_HISTOGRAM_BOOLEAN("AsyncDNS.ConfigChange", changed); |
| have_config_ = true; |
| if (have_hosts_) |
| @@ -135,10 +151,13 @@ void DnsConfigService::OnConfigRead(const DnsConfig& config) { |
| void DnsConfigService::OnHostsRead(const DnsHosts& hosts) { |
| DCHECK(CalledOnValidThread()); |
| + bool changed = false; |
| if (hosts != dns_config_.hosts) { |
| dns_config_.hosts = hosts; |
| need_update_ = true; |
| + changed = true; |
| } |
| + UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostsChange", changed); |
| have_hosts_ = true; |
| if (have_config_) |