forked from quic-go/quic-go
qlog updated metrics when sending a packet
This commit is contained in:
@@ -167,6 +167,17 @@ func (h *sentPacketHandler) dropPackets(encLevel protocol.EncryptionLevel) {
|
|||||||
h.ptoMode = SendNone
|
h.ptoMode = SendNone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *sentPacketHandler) packetsInFlight() int {
|
||||||
|
packetsInFlight := h.appDataPackets.history.Len()
|
||||||
|
if h.handshakePackets != nil {
|
||||||
|
packetsInFlight += h.handshakePackets.history.Len()
|
||||||
|
}
|
||||||
|
if h.initialPackets != nil {
|
||||||
|
packetsInFlight += h.initialPackets.history.Len()
|
||||||
|
}
|
||||||
|
return packetsInFlight
|
||||||
|
}
|
||||||
|
|
||||||
func (h *sentPacketHandler) SentPacket(packet *Packet) {
|
func (h *sentPacketHandler) SentPacket(packet *Packet) {
|
||||||
// For the client, drop the Initial packet number space when the first Handshake packet is sent.
|
// For the client, drop the Initial packet number space when the first Handshake packet is sent.
|
||||||
if h.perspective == protocol.PerspectiveClient && packet.EncryptionLevel == protocol.EncryptionHandshake && h.initialPackets != nil {
|
if h.perspective == protocol.PerspectiveClient && packet.EncryptionLevel == protocol.EncryptionHandshake && h.initialPackets != nil {
|
||||||
@@ -176,6 +187,9 @@ func (h *sentPacketHandler) SentPacket(packet *Packet) {
|
|||||||
if isAckEliciting {
|
if isAckEliciting {
|
||||||
h.getPacketNumberSpace(packet.EncryptionLevel).history.SentPacket(packet)
|
h.getPacketNumberSpace(packet.EncryptionLevel).history.SentPacket(packet)
|
||||||
}
|
}
|
||||||
|
if h.qlogger != nil {
|
||||||
|
h.qlogger.UpdatedMetrics(h.rttStats, h.congestion.GetCongestionWindow(), h.bytesInFlight, h.packetsInFlight())
|
||||||
|
}
|
||||||
if isAckEliciting || !h.peerCompletedAddressValidation {
|
if isAckEliciting || !h.peerCompletedAddressValidation {
|
||||||
h.setLossDetectionTimer()
|
h.setLossDetectionTimer()
|
||||||
}
|
}
|
||||||
@@ -256,14 +270,7 @@ func (h *sentPacketHandler) ReceivedAck(ack *wire.AckFrame, encLevel protocol.En
|
|||||||
}
|
}
|
||||||
h.congestion.MaybeExitSlowStart()
|
h.congestion.MaybeExitSlowStart()
|
||||||
if h.qlogger != nil {
|
if h.qlogger != nil {
|
||||||
packetsInFlight := h.appDataPackets.history.Len()
|
h.qlogger.UpdatedMetrics(h.rttStats, h.congestion.GetCongestionWindow(), h.bytesInFlight, h.packetsInFlight())
|
||||||
if h.handshakePackets != nil {
|
|
||||||
packetsInFlight += h.handshakePackets.history.Len()
|
|
||||||
}
|
|
||||||
if h.initialPackets != nil {
|
|
||||||
packetsInFlight += h.initialPackets.history.Len()
|
|
||||||
}
|
|
||||||
h.qlogger.UpdatedMetrics(h.rttStats, h.congestion.GetCongestionWindow(), h.bytesInFlight, packetsInFlight)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user