Add and modify a few ANA stats.
This CL adds seperate counters for ANA frame length increases and decreases, which gives more insight into what actions are taken. In addition, a new stat is added to track the sum of the uplink packet loss fraction that is set by the ANA FEC controller. BUG=webrtc:8127 Review-Url: https://codereview.webrtc.org/3007243002 Cr-Commit-Position: refs/heads/master@{#19756}
This commit is contained in:
@ -48,10 +48,17 @@ struct ANAStats {
|
||||
// call. If this value is not set, it indicates that the FEC controller is
|
||||
// disabled.
|
||||
rtc::Optional<uint32_t> fec_action_counter;
|
||||
// Number of actions taken by the ANA frame length controller since the start
|
||||
// of the call. If this value is not set, it indicates that the frame length
|
||||
// controller is disabled.
|
||||
rtc::Optional<uint32_t> frame_length_action_counter;
|
||||
// Number of times the ANA frame length controller decided to increase the
|
||||
// frame length since the start of the call. If this value is not set, it
|
||||
// indicates that the frame length controller is disabled.
|
||||
rtc::Optional<uint32_t> frame_length_increase_counter;
|
||||
// Number of times the ANA frame length controller decided to decrease the
|
||||
// frame length since the start of the call. If this value is not set, it
|
||||
// indicates that the frame length controller is disabled.
|
||||
rtc::Optional<uint32_t> frame_length_decrease_counter;
|
||||
// The uplink packet loss fractions as set by the ANA FEC controller. If this
|
||||
// value is not set, it indicates that the ANA FEC controller is not active.
|
||||
rtc::Optional<float> uplink_packet_loss_fraction;
|
||||
};
|
||||
|
||||
// This is the interface class for encoders in AudioCoding module. Each codec
|
||||
|
||||
@ -594,8 +594,12 @@ const char* StatsReport::Value::display_name() const {
|
||||
return "googAnaDtxActionCounter";
|
||||
case kStatsValueNameAnaFecActionCounter:
|
||||
return "googAnaFecActionCounter";
|
||||
case kStatsValueNameAnaFrameLengthActionCounter:
|
||||
return "googAnaFrameLengthActionCounter";
|
||||
case kStatsValueNameAnaFrameLengthIncreaseCounter:
|
||||
return "googAnaFrameLengthIncreaseCounter";
|
||||
case kStatsValueNameAnaFrameLengthDecreaseCounter:
|
||||
return "googAnaFrameLengthDecreaseCounter";
|
||||
case kStatsValueNameAnaUplinkPacketLossFraction:
|
||||
return "googAnaUplinkPacketLossFraction";
|
||||
case kStatsValueNameRetransmitBitrate:
|
||||
return "googRetransmitBitrate";
|
||||
case kStatsValueNameRtt:
|
||||
|
||||
@ -212,7 +212,9 @@ class StatsReport {
|
||||
kStatsValueNameAnaChannelActionCounter,
|
||||
kStatsValueNameAnaDtxActionCounter,
|
||||
kStatsValueNameAnaFecActionCounter,
|
||||
kStatsValueNameAnaFrameLengthActionCounter,
|
||||
kStatsValueNameAnaFrameLengthIncreaseCounter,
|
||||
kStatsValueNameAnaFrameLengthDecreaseCounter,
|
||||
kStatsValueNameAnaUplinkPacketLossFraction,
|
||||
kStatsValueNameRetransmitBitrate,
|
||||
kStatsValueNameRtt,
|
||||
kStatsValueNameSecondaryDecodedRate,
|
||||
|
||||
@ -550,8 +550,12 @@ class WebRtcVoiceEngineTestFake : public testing::Test {
|
||||
stats.ana_statistics.channel_action_counter = rtc::Optional<uint32_t>(432);
|
||||
stats.ana_statistics.dtx_action_counter = rtc::Optional<uint32_t>(543);
|
||||
stats.ana_statistics.fec_action_counter = rtc::Optional<uint32_t>(654);
|
||||
stats.ana_statistics.frame_length_action_counter =
|
||||
stats.ana_statistics.frame_length_increase_counter =
|
||||
rtc::Optional<uint32_t>(765);
|
||||
stats.ana_statistics.frame_length_decrease_counter =
|
||||
rtc::Optional<uint32_t>(876);
|
||||
stats.ana_statistics.uplink_packet_loss_fraction =
|
||||
rtc::Optional<float>(987.0);
|
||||
stats.typing_noise_detected = true;
|
||||
return stats;
|
||||
}
|
||||
@ -591,8 +595,12 @@ class WebRtcVoiceEngineTestFake : public testing::Test {
|
||||
stats.ana_statistics.dtx_action_counter);
|
||||
EXPECT_EQ(info.ana_statistics.fec_action_counter,
|
||||
stats.ana_statistics.fec_action_counter);
|
||||
EXPECT_EQ(info.ana_statistics.frame_length_action_counter,
|
||||
stats.ana_statistics.frame_length_action_counter);
|
||||
EXPECT_EQ(info.ana_statistics.frame_length_increase_counter,
|
||||
stats.ana_statistics.frame_length_increase_counter);
|
||||
EXPECT_EQ(info.ana_statistics.frame_length_decrease_counter,
|
||||
stats.ana_statistics.frame_length_decrease_counter);
|
||||
EXPECT_EQ(info.ana_statistics.uplink_packet_loss_fraction,
|
||||
stats.ana_statistics.uplink_packet_loss_fraction);
|
||||
EXPECT_EQ(info.typing_noise_detected,
|
||||
stats.typing_noise_detected && is_sending);
|
||||
}
|
||||
|
||||
@ -298,8 +298,12 @@ TEST(AudioNetworkAdaptorImplTest, TestANAStats) {
|
||||
default_stats.channel_action_counter);
|
||||
EXPECT_EQ(ana_stats.dtx_action_counter, default_stats.dtx_action_counter);
|
||||
EXPECT_EQ(ana_stats.fec_action_counter, default_stats.fec_action_counter);
|
||||
EXPECT_EQ(ana_stats.frame_length_action_counter,
|
||||
default_stats.frame_length_action_counter);
|
||||
EXPECT_EQ(ana_stats.frame_length_increase_counter,
|
||||
default_stats.frame_length_increase_counter);
|
||||
EXPECT_EQ(ana_stats.frame_length_decrease_counter,
|
||||
default_stats.frame_length_decrease_counter);
|
||||
EXPECT_EQ(ana_stats.uplink_packet_loss_fraction,
|
||||
default_stats.uplink_packet_loss_fraction);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -240,9 +240,17 @@ void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) {
|
||||
report->AddInt(StatsReport::kStatsValueNameAnaFecActionCounter,
|
||||
*info.ana_statistics.fec_action_counter);
|
||||
}
|
||||
if (info.ana_statistics.frame_length_action_counter) {
|
||||
report->AddInt(StatsReport::kStatsValueNameAnaFrameLengthActionCounter,
|
||||
*info.ana_statistics.frame_length_action_counter);
|
||||
if (info.ana_statistics.frame_length_increase_counter) {
|
||||
report->AddInt(StatsReport::kStatsValueNameAnaFrameLengthIncreaseCounter,
|
||||
*info.ana_statistics.frame_length_increase_counter);
|
||||
}
|
||||
if (info.ana_statistics.frame_length_decrease_counter) {
|
||||
report->AddInt(StatsReport::kStatsValueNameAnaFrameLengthDecreaseCounter,
|
||||
*info.ana_statistics.frame_length_decrease_counter);
|
||||
}
|
||||
if (info.ana_statistics.uplink_packet_loss_fraction) {
|
||||
report->AddFloat(StatsReport::kStatsValueNameAnaUplinkPacketLossFraction,
|
||||
*info.ana_statistics.uplink_packet_loss_fraction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -454,13 +454,27 @@ void VerifyVoiceSenderInfoReport(const StatsReport* report,
|
||||
ASSERT_TRUE(sinfo.ana_statistics.fec_action_counter);
|
||||
EXPECT_EQ(rtc::ToString<uint32_t>(*sinfo.ana_statistics.fec_action_counter),
|
||||
value_in_report);
|
||||
EXPECT_TRUE(GetValue(report,
|
||||
StatsReport::kStatsValueNameAnaFrameLengthActionCounter,
|
||||
&value_in_report));
|
||||
ASSERT_TRUE(sinfo.ana_statistics.frame_length_action_counter);
|
||||
EXPECT_TRUE(GetValue(
|
||||
report, StatsReport::kStatsValueNameAnaFrameLengthIncreaseCounter,
|
||||
&value_in_report));
|
||||
ASSERT_TRUE(sinfo.ana_statistics.frame_length_increase_counter);
|
||||
EXPECT_EQ(rtc::ToString<uint32_t>(
|
||||
*sinfo.ana_statistics.frame_length_action_counter),
|
||||
*sinfo.ana_statistics.frame_length_increase_counter),
|
||||
value_in_report);
|
||||
EXPECT_TRUE(GetValue(
|
||||
report, StatsReport::kStatsValueNameAnaFrameLengthDecreaseCounter,
|
||||
&value_in_report));
|
||||
ASSERT_TRUE(sinfo.ana_statistics.frame_length_decrease_counter);
|
||||
EXPECT_EQ(rtc::ToString<uint32_t>(
|
||||
*sinfo.ana_statistics.frame_length_decrease_counter),
|
||||
value_in_report);
|
||||
EXPECT_TRUE(GetValue(report,
|
||||
StatsReport::kStatsValueNameAnaUplinkPacketLossFraction,
|
||||
&value_in_report));
|
||||
ASSERT_TRUE(sinfo.ana_statistics.uplink_packet_loss_fraction);
|
||||
EXPECT_EQ(
|
||||
rtc::ToString<float>(*sinfo.ana_statistics.uplink_packet_loss_fraction),
|
||||
value_in_report);
|
||||
}
|
||||
|
||||
// Helper methods to avoid duplication of code.
|
||||
@ -489,8 +503,12 @@ void InitVoiceSenderInfo(cricket::VoiceSenderInfo* voice_sender_info) {
|
||||
rtc::Optional<uint32_t>(115);
|
||||
voice_sender_info->ana_statistics.fec_action_counter =
|
||||
rtc::Optional<uint32_t>(116);
|
||||
voice_sender_info->ana_statistics.frame_length_action_counter =
|
||||
voice_sender_info->ana_statistics.frame_length_increase_counter =
|
||||
rtc::Optional<uint32_t>(117);
|
||||
voice_sender_info->ana_statistics.frame_length_decrease_counter =
|
||||
rtc::Optional<uint32_t>(118);
|
||||
voice_sender_info->ana_statistics.uplink_packet_loss_fraction =
|
||||
rtc::Optional<float>(119.0);
|
||||
}
|
||||
|
||||
void UpdateVoiceSenderInfoFromAudioTrack(
|
||||
|
||||
Reference in New Issue
Block a user