For quic loss detection, replace quicconnectionstats.total_loss_detection_time by quicconnectionstats. total_loss_detection_response_time to improve the accuracy of detection speed. protected by existing --gfe2_reloadable_flag_quic_enable_loss_detection_experiment_at_gfe.

On skmobile-cjj5 this reduced the threshold value from 8 to 4.5: http://shortn/_vT0AbUjKU6. shift value did not change.

PiperOrigin-RevId: 317739228
Change-Id: I091fabc50753c754c9377d79f7b5a77878d8fbc8
diff --git a/quic/core/quic_connection_stats.h b/quic/core/quic_connection_stats.h
index 67220ae..d0211da 100644
--- a/quic/core/quic_connection_stats.h
+++ b/quic/core/quic_connection_stats.h
@@ -47,9 +47,21 @@
   QuicPacketCount packets_lost = 0;
   QuicPacketCount packet_spuriously_detected_lost = 0;
 
-  // The sum of the detection time of all lost packets. The detection time of a
-  // lost packet is defined as: T(detection) - T(send).
-  QuicTime::Delta total_loss_detection_time = QuicTime::Delta::Zero();
+  // The sum of loss detection response times of all lost packets, in number of
+  // round trips.
+  // Given a packet detected as lost:
+  //   T(S)                            T(1Rtt)    T(D)
+  //     |_________________________________|_______|
+  // Where
+  //   T(S) is the time when the packet is sent.
+  //   T(1Rtt) is one rtt after T(S), using the rtt at the time of detection.
+  //   T(D) is the time of detection, i.e. when the packet is declared as lost.
+  // The loss detection response time is defined as
+  //     (T(D) - T(S)) / (T(1Rtt) - T(S))
+  //
+  // The average loss detection response time is this number divided by
+  // |packets_lost|. Smaller result means detection is faster.
+  float total_loss_detection_response_time = 0.0;
 
   // Number of times this connection went through the slow start phase.
   uint32_t slowstart_count = 0;