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,
}
}
void LogMigrateToSocketStatus(bool success) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.MigrateToSocketSuccess", success);
}
void RecordConnectionCloseErrorCode(const quic::QuicConnectionCloseFrame& frame,
quic::ConnectionCloseSource source,
const std::string& hostname,
......@@ -865,6 +869,7 @@ QuicChromiumClientSession::QuicChromiumClientSession(
max_allowed_push_id_(max_allowed_push_id),
attempted_zero_rtt_(false),
num_pings_sent_(0),
num_migrations_(0),
push_promise_index_(std::move(push_promise_index)) {
// Make sure connection migration and goaway on path degrading are not turned
// on at the same time.
......@@ -1875,6 +1880,7 @@ void QuicChromiumClientSession::OnConnectionClosed(
UMA_HISTOGRAM_LONG_TIMES_100(
"Net.QuicSession.ConnectionDuration",
tick_clock_->NowTicks() - connect_timing_.connect_end);
UMA_HISTOGRAM_COUNTS_100("Net.QuicSession.NumMigrations", num_migrations_);
} else {
if (error == quic::QUIC_PUBLIC_RESET) {
RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET);
......@@ -2178,11 +2184,14 @@ void QuicChromiumClientSession::OnProbeSucceeded(
// be acquired by connection and used as default on success.
if (!MigrateToSocket(std::move(socket), std::move(reader),
std::move(writer))) {
LogMigrateToSocketStatus(false);
net_log_.AddEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_FAILURE_AFTER_PROBING);
return;
}
LogMigrateToSocketStatus(true);
// Notify the connection that migration succeeds after probing.
if (connection()->IsPathDegrading())
connection()->OnSuccessfulMigrationAfterProbing();
......@@ -2190,6 +2199,7 @@ void QuicChromiumClientSession::OnProbeSucceeded(
net_log_.AddEventWithInt64Params(
NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS_AFTER_PROBING,
"migrate_to_network", network);
num_migrations_++;
HistogramAndLogMigrationSuccess(connection_id());
if (network == default_network_) {
DVLOG(1) << "Client successfully migrated to default network: "
......
......@@ -930,6 +930,8 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
size_t num_pings_sent_;
size_t num_migrations_;
std::unique_ptr<quic::QuicClientPushPromiseIndex> push_promise_index_;
base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_{this};
......
......@@ -2996,6 +2996,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</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">
<owner>dschinazi@chromium.org</owner>
<owner>src/net/quic/OWNERS</owner>
......@@ -3024,6 +3034,13 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</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"
units="migrations" expires_after="2021-05-11">
<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