Commit bfbb6f28 authored by Renjie Tang's avatar Renjie Tang Committed by Commit Bot

Fix QuicSession.ConnectionDuration

What went wrong: Previously handshake_completion_timestamp_ was only stamped at OnOneRttKeysAvailable().
But from the base method in the shared code, this method is only called with TLS QUIC. Thus this histogram is broken for gQUIC.

connection_timing_.connect_end works for both QUIC versions.

Change-Id: Ie3b60a8d4169b3a6ccc32b79877290275f26bbc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358369
Auto-Submit: Renjie Tang <renjietang@chromium.org>
Reviewed-by: default avatarDavid Schinazi <dschinazi@chromium.org>
Commit-Queue: David Schinazi <dschinazi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798410}
parent c9836682
......@@ -862,7 +862,6 @@ QuicChromiumClientSession::QuicChromiumClientSession(
max_allowed_push_id_(max_allowed_push_id),
attempted_zero_rtt_(false),
num_pings_sent_(0),
handshake_completion_timestamp_(base::TimeTicks()),
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.
......@@ -1611,7 +1610,6 @@ void QuicChromiumClientSession::OnOneRttKeysAvailable() {
OnCryptoHandshakeComplete();
LogZeroRttStats();
handshake_completion_timestamp_ = tick_clock_->NowTicks();
quic::QuicSpdySession::OnOneRttKeysAvailable();
}
......@@ -1800,7 +1798,7 @@ void QuicChromiumClientSession::OnConnectionClosed(
UMA_HISTOGRAM_COUNTS_1000("Net.QuicSession.NumPingsSent", num_pings_sent_);
UMA_HISTOGRAM_LONG_TIMES_100(
"Net.QuicSession.ConnectionDuration",
tick_clock_->NowTicks() - handshake_completion_timestamp_);
tick_clock_->NowTicks() - connect_timing_.connect_end);
} else {
if (error == quic::QUIC_PUBLIC_RESET) {
RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET);
......
......@@ -929,8 +929,6 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
size_t num_pings_sent_;
base::TimeTicks handshake_completion_timestamp_;
std::unique_ptr<quic::QuicClientPushPromiseIndex> push_promise_index_;
base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_{this};
......
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