| Index: components/domain_reliability/context_manager.cc
|
| diff --git a/components/domain_reliability/context_manager.cc b/components/domain_reliability/context_manager.cc
|
| index bcdb530de64d7b639438cf5a11e4fec6af57598c..81811c940c8edce21988bb2801e79904dbf33b29 100644
|
| --- a/components/domain_reliability/context_manager.cc
|
| +++ b/components/domain_reliability/context_manager.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include <utility>
|
|
|
| +#include "base/metrics/histogram_macros.h"
|
| +
|
| namespace domain_reliability {
|
|
|
| DomainReliabilityContextManager::DomainReliabilityContextManager(
|
| @@ -24,7 +26,16 @@ void DomainReliabilityContextManager::RouteBeacon(
|
| if (!context)
|
| return;
|
|
|
| - context->OnBeacon(std::move(beacon));
|
| + bool queued = context->OnBeacon(std::move(beacon));
|
| + if (!queued)
|
| + return;
|
| +
|
| + base::TimeTicks now = base::TimeTicks::Now();
|
| + if (!last_routed_beacon_time_.is_null()) {
|
| + UMA_HISTOGRAM_LONG_TIMES("DomainReliability.BeaconIntervalGlobal",
|
| + now - last_routed_beacon_time_);
|
| + }
|
| + last_routed_beacon_time_ = now;
|
| }
|
|
|
| void DomainReliabilityContextManager::SetConfig(
|
| @@ -45,7 +56,10 @@ void DomainReliabilityContextManager::SetConfig(
|
| // pending beacons and collector backoff state. Therefore, don't do so
|
| // needlessly; make sure the config has actually changed before recreating
|
| // the context.
|
| - if (contexts_[key]->config().Equals(*config)) {
|
| + bool config_same = contexts_[key]->config().Equals(*config);
|
| + UMA_HISTOGRAM_BOOLEAN("DomainReliability.SetConfigRecreatedContext",
|
| + !config_same);
|
| + if (!config_same) {
|
| DVLOG(1) << "Ignoring unchanged NEL header for existing origin "
|
| << origin.spec() << ".";
|
| return;
|
|
|