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

Unified Diff: components/domain_reliability/context_manager.cc

Issue 2466093002: Domain Reliability: Add more upload-related histograms. (Closed)
Patch Set: Created 4 years, 1 month 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 | « components/domain_reliability/context_manager.h ('k') | components/domain_reliability/uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..256195fcecd5145b509b57d0fbeb57ee12883ab7 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(
@@ -48,13 +59,16 @@ void DomainReliabilityContextManager::SetConfig(
if (contexts_[key]->config().Equals(*config)) {
DVLOG(1) << "Ignoring unchanged NEL header for existing origin "
<< origin.spec() << ".";
+ UMA_HISTOGRAM_BOOLEAN("DomainReliability.SetConfigRecreatedContext",
+ false);
return;
+ } else {
+ UMA_HISTOGRAM_BOOLEAN("DomainReliability.SetConfigRecreatedContext",
+ true);
Alexei Svitkine (slow) 2016/11/01 14:49:46 Please refactor the code to avoid having two macro
Julia Tuttle 2016/11/01 15:52:47 Done.
}
// TODO(juliatuttle): Make Context accept Config changes.
}
- DVLOG(1) << "Adding/replacing context for existing origin " << origin.spec()
Julia Tuttle 2016/10/31 23:32:05 Note to self: Put this back.
Julia Tuttle 2016/11/01 15:52:47 Done.
- << ".";
removed_contexts_.erase(key);
config->origin = origin;
AddContextForConfig(std::move(config));
« no previous file with comments | « components/domain_reliability/context_manager.h ('k') | components/domain_reliability/uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698