Skip to content

Commit

Permalink
Less UMA histograms for packets
Browse files Browse the repository at this point in the history
  • Loading branch information
jellefoks committed Nov 19, 2024
1 parent 375f327 commit 8e30f6b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions net/quic/quic_connection_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ void QuicConnectionLogger::OnPacketSent(
const quic::QuicFrames& retransmittable_frames,
const quic::QuicFrames& nonretransmittable_frames,
quic::QuicTime sent_time) {
#if defined(STARBOARD)
// We disable the packet sending logging in Cobalt for performance
// reasons.
return;
#else
// 4.4.1.4. Minimum Packet Size
// The payload of a UDP datagram carrying the Initial packet MUST be
// expanded to at least 1200 octets
Expand Down Expand Up @@ -216,6 +221,7 @@ void QuicConnectionLogger::OnPacketSent(
transmission_type, encryption_level,
retransmittable_frames, nonretransmittable_frames,
sent_time);
#endif
}

void QuicConnectionLogger::OnPacketLoss(
Expand All @@ -241,6 +247,11 @@ void QuicConnectionLogger::OnPacketReceived(
const quic::QuicSocketAddress& self_address,
const quic::QuicSocketAddress& peer_address,
const quic::QuicEncryptedPacket& packet) {
#if defined(STARBOARD)
// We disable the packet receiving logging in Cobalt for performance
// reasons.
return;
#else
if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) {
local_address_from_self_ = ToIPEndPoint(self_address);
UMA_HISTOGRAM_ENUMERATION(
Expand All @@ -252,6 +263,7 @@ void QuicConnectionLogger::OnPacketReceived(
previous_received_packet_size_ = last_received_packet_size_;
last_received_packet_size_ = packet.length();
event_logger_.OnPacketReceived(self_address, peer_address, packet);
#endif
}

void QuicConnectionLogger::OnUnauthenticatedHeader(
Expand Down Expand Up @@ -290,6 +302,11 @@ void QuicConnectionLogger::OnProtocolVersionMismatch(
void QuicConnectionLogger::OnPacketHeader(const quic::QuicPacketHeader& header,
quic::QuicTime receive_time,
quic::EncryptionLevel level) {
#if defined(STARBOARD)
// We disable the packet header receiving logging in Cobalt for performance
// reasons.
return;
#else
if (!first_received_packet_number_.IsInitialized()) {
first_received_packet_number_ = header.packet_number;
} else if (header.packet_number < first_received_packet_number_) {
Expand Down Expand Up @@ -337,6 +354,7 @@ void QuicConnectionLogger::OnPacketHeader(const quic::QuicPacketHeader& header,
}
last_received_packet_number_ = header.packet_number;
event_logger_.OnPacketHeader(header, receive_time, level);
#endif
}

void QuicConnectionLogger::OnStreamFrame(const quic::QuicStreamFrame& frame) {
Expand Down

0 comments on commit 8e30f6b

Please sign in to comment.