From d691aeac264a5d5712d90f4c4313bf40fe7437c7 Mon Sep 17 00:00:00 2001 From: Jelle Foks Date: Mon, 11 Nov 2024 17:59:09 -0800 Subject: [PATCH] Less UMA histograms for packets --- net/quic/quic_connection_logger.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc index 3d61be149314..52526aa62229 100644 --- a/net/quic/quic_connection_logger.cc +++ b/net/quic/quic_connection_logger.cc @@ -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 @@ -216,6 +221,7 @@ void QuicConnectionLogger::OnPacketSent( transmission_type, encryption_level, retransmittable_frames, nonretransmittable_frames, sent_time); +#endif } void QuicConnectionLogger::OnPacketLoss( @@ -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( @@ -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( @@ -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_) { @@ -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) {