Commit 714be613 authored by Renjie Tang's avatar Renjie Tang Committed by Commit Bot

Add histograms to understand how often migration to new socket fails and why.

Bug: b/171063562
Change-Id: Ib17016732a59cb434855af3098288ec4147fb939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488700
Commit-Queue: Renjie Tang <renjietang@chromium.org>
Reviewed-by: default avatarDavid Schinazi <dschinazi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819186}
parent 4c8dbad7
...@@ -135,6 +135,10 @@ void RecordConnectionCloseErrorCodeImpl(const std::string& histogram, ...@@ -135,6 +135,10 @@ void RecordConnectionCloseErrorCodeImpl(const std::string& histogram,
} }
} }
void LogMigrateToSocketStatus(bool success) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.MigrateToSocketSuccess", success);
}
void RecordConnectionCloseErrorCode(const quic::QuicConnectionCloseFrame& frame, void RecordConnectionCloseErrorCode(const quic::QuicConnectionCloseFrame& frame,
quic::ConnectionCloseSource source, quic::ConnectionCloseSource source,
const std::string& hostname, const std::string& hostname,
...@@ -865,6 +869,7 @@ QuicChromiumClientSession::QuicChromiumClientSession( ...@@ -865,6 +869,7 @@ QuicChromiumClientSession::QuicChromiumClientSession(
max_allowed_push_id_(max_allowed_push_id), max_allowed_push_id_(max_allowed_push_id),
attempted_zero_rtt_(false), attempted_zero_rtt_(false),
num_pings_sent_(0), num_pings_sent_(0),
num_migrations_(0),
push_promise_index_(std::move(push_promise_index)) { push_promise_index_(std::move(push_promise_index)) {
// Make sure connection migration and goaway on path degrading are not turned // Make sure connection migration and goaway on path degrading are not turned
// on at the same time. // on at the same time.
...@@ -1875,6 +1880,7 @@ void QuicChromiumClientSession::OnConnectionClosed( ...@@ -1875,6 +1880,7 @@ void QuicChromiumClientSession::OnConnectionClosed(
UMA_HISTOGRAM_LONG_TIMES_100( UMA_HISTOGRAM_LONG_TIMES_100(
"Net.QuicSession.ConnectionDuration", "Net.QuicSession.ConnectionDuration",
tick_clock_->NowTicks() - connect_timing_.connect_end); tick_clock_->NowTicks() - connect_timing_.connect_end);
UMA_HISTOGRAM_COUNTS_100("Net.QuicSession.NumMigrations", num_migrations_);
} else { } else {
if (error == quic::QUIC_PUBLIC_RESET) { if (error == quic::QUIC_PUBLIC_RESET) {
RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET); RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET);
...@@ -2178,11 +2184,14 @@ void QuicChromiumClientSession::OnProbeSucceeded( ...@@ -2178,11 +2184,14 @@ void QuicChromiumClientSession::OnProbeSucceeded(
// be acquired by connection and used as default on success. // be acquired by connection and used as default on success.
if (!MigrateToSocket(std::move(socket), std::move(reader), if (!MigrateToSocket(std::move(socket), std::move(reader),
std::move(writer))) { std::move(writer))) {
LogMigrateToSocketStatus(false);
net_log_.AddEvent( net_log_.AddEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_FAILURE_AFTER_PROBING); NetLogEventType::QUIC_CONNECTION_MIGRATION_FAILURE_AFTER_PROBING);
return; return;
} }
LogMigrateToSocketStatus(true);
// Notify the connection that migration succeeds after probing. // Notify the connection that migration succeeds after probing.
if (connection()->IsPathDegrading()) if (connection()->IsPathDegrading())
connection()->OnSuccessfulMigrationAfterProbing(); connection()->OnSuccessfulMigrationAfterProbing();
...@@ -2190,6 +2199,7 @@ void QuicChromiumClientSession::OnProbeSucceeded( ...@@ -2190,6 +2199,7 @@ void QuicChromiumClientSession::OnProbeSucceeded(
net_log_.AddEventWithInt64Params( net_log_.AddEventWithInt64Params(
NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS_AFTER_PROBING, NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS_AFTER_PROBING,
"migrate_to_network", network); "migrate_to_network", network);
num_migrations_++;
HistogramAndLogMigrationSuccess(connection_id()); HistogramAndLogMigrationSuccess(connection_id());
if (network == default_network_) { if (network == default_network_) {
DVLOG(1) << "Client successfully migrated to default network: " DVLOG(1) << "Client successfully migrated to default network: "
......
...@@ -930,6 +930,8 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession ...@@ -930,6 +930,8 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
size_t num_pings_sent_; size_t num_pings_sent_;
size_t num_migrations_;
std::unique_ptr<quic::QuicClientPushPromiseIndex> push_promise_index_; std::unique_ptr<quic::QuicClientPushPromiseIndex> push_promise_index_;
base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_{this}; base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_{this};
......
...@@ -2996,6 +2996,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -2996,6 +2996,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.QuicSession.MigrateToSocketSuccess" enum="Boolean"
expires_after="2021-05-11">
<owner>renjietang@chromium.org</owner>
<owner>src/net/quic/OWNERS</owner>
<summary>
Records whether the migration of the QuicSession to a new socket is
successful.
</summary>
</histogram>
<histogram name="Net.QuicSession.MinRTT" units="ms" expires_after="2021-05-11"> <histogram name="Net.QuicSession.MinRTT" units="ms" expires_after="2021-05-11">
<owner>dschinazi@chromium.org</owner> <owner>dschinazi@chromium.org</owner>
<owner>src/net/quic/OWNERS</owner> <owner>src/net/quic/OWNERS</owner>
...@@ -3024,6 +3034,13 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -3024,6 +3034,13 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.QuicSession.NumMigrations" units="units"
expires_after="2021-05-11">
<owner>renjietang@chromium.org</owner>
<owner>src/net/quic/OWNERS</owner>
<summary>The number of successful migrations for a QUIC session.</summary>
</histogram>
<histogram name="Net.QuicSession.NumMigrationsExercisedBeforePublicReset" <histogram name="Net.QuicSession.NumMigrationsExercisedBeforePublicReset"
units="migrations" expires_after="2021-05-11"> units="migrations" expires_after="2021-05-11">
<owner>zhongyi@chromium.org</owner> <owner>zhongyi@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment