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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2359803003: Job Controller: clean up metrics logging about the job racing result (Closed)
Patch Set: sync Created 4 years, 3 months 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 | « net/http/http_stream_factory_impl_job_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job_controller.cc
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc
index 11d1f6ef9de91417f751f7b545f8bb2e88d06ecc..e76435f18ce4c1eb8511024e7ca222c47277bd22 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -746,10 +746,8 @@ void HttpStreamFactoryImpl::JobController::OnJobSucceeded(Job* job) {
ReportBrokenAlternativeService();
if (!bound_job_) {
- if (main_job_ && alternative_job_) {
- job->ReportJobSucceededForRequest();
- MaybeRecordAlternativeProxyServerUsage(job);
- }
+ if (main_job_ && alternative_job_)
+ ReportAlternateProtocolUsage(job);
BindJob(job);
return;
}
@@ -906,7 +904,7 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceForInternal(
quic_advertised = true;
if (http_server_properties.IsAlternativeServiceBroken(
alternative_service)) {
- HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN);
+ HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN, false);
continue;
}
@@ -1054,37 +1052,28 @@ bool HttpStreamFactoryImpl::JobController::
return true;
}
-void HttpStreamFactoryImpl::JobController::
- MaybeRecordAlternativeProxyServerUsage(Job* job) const {
- if (is_preconnect_ ||
- !alternative_job_->alternative_proxy_server().is_quic()) {
+void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage(
+ Job* job) const {
+ DCHECK(main_job_ && alternative_job_);
+
+ bool proxy_server_used =
+ alternative_job_->alternative_proxy_server().is_quic();
+
+ if (job == main_job_.get()) {
+ HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_LOST_RACE,
+ proxy_server_used);
return;
}
- DCHECK(main_job_.get() == job || alternative_job_.get() == job);
-
- enum AlternativeProxyUsage {
- ALTERNATIVE_PROXY_USAGE_NO_RACE = 0,
- ALTERNATIVE_PROXY_USAGE_WON_RACE,
- ALTERNATIVE_PROXY_USAGE_LOST_RACE,
- ALTERNATIVE_PROXY_USAGE_MAX,
- };
- AlternativeProxyUsage alternative_proxy_usage = ALTERNATIVE_PROXY_USAGE_MAX;
-
- if (alternative_job_->using_existing_quic_session()) {
- // If an existing session was used, then no TCP connection was
- // started.
- alternative_proxy_usage = ALTERNATIVE_PROXY_USAGE_NO_RACE;
- } else if (job->alternative_proxy_server().is_quic()) {
- // |job| was the alternative Job, and hence won the race.
- alternative_proxy_usage = ALTERNATIVE_PROXY_USAGE_WON_RACE;
- } else {
- // |job| was the normal Job, and hence the alternative Job lost the race.
- alternative_proxy_usage = ALTERNATIVE_PROXY_USAGE_LOST_RACE;
+
+ DCHECK_EQ(alternative_job_.get(), job);
+ if (job->using_existing_quic_session()) {
+ HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE,
+ proxy_server_used);
+ return;
}
- DCHECK_NE(ALTERNATIVE_PROXY_USAGE_MAX, alternative_proxy_usage);
- UMA_HISTOGRAM_ENUMERATION("Net.QuicAlternativeProxy.Usage",
- alternative_proxy_usage,
- ALTERNATIVE_PROXY_USAGE_MAX);
+
+ HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE,
+ proxy_server_used);
}
void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() {
« no previous file with comments | « net/http/http_stream_factory_impl_job_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698