| Index: net/dns/dns_config_service.cc
|
| diff --git a/net/dns/dns_config_service.cc b/net/dns/dns_config_service.cc
|
| index 43acf481007349962f73a8c31f82e1cd510313cf..a520d261b9dbe6ac2f53a5e786ff766eeb55634f 100644
|
| --- a/net/dns/dns_config_service.cc
|
| +++ b/net/dns/dns_config_service.cc
|
| @@ -152,6 +152,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.ConfigNotifyInterval",
|
| + now - last_invalidate_config_time_);
|
| + }
|
| + last_invalidate_config_time_ = now;
|
| if (!have_config_)
|
| return;
|
| have_config_ = false;
|
| @@ -160,6 +166,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.HostsNotifyInterval",
|
| + now - last_invalidate_hosts_time_);
|
| + }
|
| + last_invalidate_hosts_time_ = now;
|
| if (!have_hosts_)
|
| return;
|
| have_hosts_ = false;
|
| @@ -170,10 +182,17 @@ 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;
|
| }
|
| + if (!changed && !last_sent_empty_time_.is_null()) {
|
| + UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.UnchangedConfigInterval",
|
| + base::TimeTicks::Now() - last_sent_empty_time_);
|
| + }
|
| + UMA_HISTOGRAM_BOOLEAN("AsyncDNS.ConfigChange", changed);
|
|
|
| have_config_ = true;
|
| if (have_hosts_)
|
| @@ -183,10 +202,17 @@ 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;
|
| + }
|
| + if (!changed && !last_sent_empty_time_.is_null()) {
|
| + UMA_HISTOGRAM_LONG_TIMES("AsyncDNS.UnchangedHostsInterval",
|
| + base::TimeTicks::Now() - last_sent_empty_time_);
|
| }
|
| + UMA_HISTOGRAM_BOOLEAN("AsyncDNS.HostsChange", changed);
|
|
|
| have_hosts_ = true;
|
| if (have_config_)
|
| @@ -226,6 +252,7 @@ void DnsConfigService::OnTimeout() {
|
| need_update_ = true;
|
| // Empty config is considered invalid.
|
| last_sent_empty_ = true;
|
| + last_sent_empty_time_ = base::TimeTicks::Now();
|
| callback_.Run(DnsConfig());
|
| }
|
|
|
|
|