Add probe logging to RtcEventLog.

In this CL:
 - Add message BweProbeCluster and BweProbeResult to rtc_event_log.proto.
 - Add corresponding log functions to RtcEventLog.
 - Add optional field |probe_cluster_id| to RtpPacket message and added
   an overload function to log with this information.
 - Propagate the probe_cluster_id to where RTP packets are logged.

BUG=webrtc:6984

Review-Url: https://codereview.webrtc.org/2666533002
Cr-Commit-Position: refs/heads/master@{#16857}
This commit is contained in:
philipel
2017-02-27 02:18:46 -08:00
committed by Commit bot
parent f284b7ff5f
commit 32d0010d86
14 changed files with 490 additions and 15 deletions

View File

@ -578,7 +578,7 @@ size_t RTPSender::SendPadData(size_t bytes,
pacing_info);
}
if (!SendPacketToNetwork(padding_packet, options))
if (!SendPacketToNetwork(padding_packet, options, pacing_info))
break;
bytes_sent += padding_bytes_in_packet;
@ -630,7 +630,8 @@ int32_t RTPSender::ReSendPacket(uint16_t packet_id, int64_t min_resend_time) {
}
bool RTPSender::SendPacketToNetwork(const RtpPacketToSend& packet,
const PacketOptions& options) {
const PacketOptions& options,
const PacedPacketInfo& pacing_info) {
int bytes_sent = -1;
if (transport_) {
UpdateRtpOverhead(packet);
@ -639,7 +640,7 @@ bool RTPSender::SendPacketToNetwork(const RtpPacketToSend& packet,
: -1;
if (event_log_ && bytes_sent > 0) {
event_log_->LogRtpHeader(kOutgoingPacket, MediaType::ANY, packet.data(),
packet.size());
packet.size(), pacing_info.probe_cluster_id);
}
}
TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"),
@ -760,7 +761,7 @@ bool RTPSender::PrepareAndSendPacket(std::unique_ptr<RtpPacketToSend> packet,
packet->Ssrc());
}
if (!SendPacketToNetwork(*packet_to_send, options))
if (!SendPacketToNetwork(*packet_to_send, options, pacing_info))
return false;
{
@ -890,7 +891,7 @@ bool RTPSender::SendToNetwork(std::unique_ptr<RtpPacketToSend> packet,
UpdateOnSendPacket(options.packet_id, packet->capture_time_ms(),
packet->Ssrc());
bool sent = SendPacketToNetwork(*packet, options);
bool sent = SendPacketToNetwork(*packet, options, PacedPacketInfo());
if (sent) {
{

View File

@ -230,7 +230,8 @@ class RTPSender {
const RtpPacketToSend& packet);
bool SendPacketToNetwork(const RtpPacketToSend& packet,
const PacketOptions& options);
const PacketOptions& options,
const PacedPacketInfo& pacing_info);
void UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms);
void UpdateOnSendPacket(int packet_id,

View File

@ -426,7 +426,7 @@ TEST_F(RtpSenderTest, TrafficSmoothingWithExtensions) {
EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kNormalPriority,
kSsrc, kSeqNum, _, _, _));
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _));
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _));
rtp_sender_->SetStorePacketsStatus(true, 10);
EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
@ -471,7 +471,7 @@ TEST_F(RtpSenderTest, TrafficSmoothingRetransmits) {
EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kNormalPriority,
kSsrc, kSeqNum, _, _, _));
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _));
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _));
rtp_sender_->SetStorePacketsStatus(true, 10);
EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
@ -525,7 +525,7 @@ TEST_F(RtpSenderTest, SendPadding) {
EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kNormalPriority,
kSsrc, kSeqNum, _, _, _));
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _))
.Times(1 + 4 + 1);
uint16_t seq_num = kSeqNum;
@ -726,7 +726,7 @@ TEST_F(RtpSenderTest, SendRedundantPayloads) {
InsertPacket(RtpPacketSender::kNormalPriority, kSsrc, _, _, _, _))
.Times(kNumPayloadSizes);
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _))
.Times(kNumPayloadSizes);
// Send 10 packets of increasing size.
@ -740,7 +740,7 @@ TEST_F(RtpSenderTest, SendRedundantPayloads) {
}
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _))
.Times(::testing::AtLeast(4));
// The amount of padding to send it too small to send a payload packet.
@ -835,7 +835,7 @@ TEST_F(RtpSenderTest, SendFlexfecPackets) {
.WillOnce(testing::SaveArg<2>(&flexfec_seq_num));
SendGenericPayload();
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _))
.Times(2);
EXPECT_TRUE(rtp_sender_->TimeToSendPacket(kMediaSsrc, kSeqNum,
fake_clock_.TimeInMilliseconds(),
@ -881,7 +881,7 @@ TEST_F(RtpSenderTestWithoutPacer, SendFlexfecPackets) {
rtp_sender_->SetFecParameters(params, params);
EXPECT_CALL(mock_rtc_event_log_,
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _))
LogRtpHeader(PacketDirection::kOutgoingPacket, _, _, _, _))
.Times(2);
SendGenericPayload();
ASSERT_EQ(2, transport_.packets_sent());