Change BuiltInNetworkBehaviorConfig.loss_percent to double

This should allow greater precision in the lower ranges of packet loss.

Bug: chromium:41175925
Change-Id: Ia35059ad673a3782443b23772511b0b952b07ce7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/341263
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41822}
This commit is contained in:
Florent Castelli 2024-02-27 11:19:30 +00:00 committed by WebRTC LUCI CQ
parent e39f6fd7fd
commit 524a06bc54
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ NetworkEmulationManager::SimulatedNetworkNode::Builder::capacity_Mbps(
NetworkEmulationManager::SimulatedNetworkNode::Builder&
NetworkEmulationManager::SimulatedNetworkNode::Builder::loss(double loss_rate) {
config_.loss_percent = std::round(loss_rate * 100);
config_.loss_percent = loss_rate * 100;
return *this;
}

View File

@ -60,8 +60,8 @@ struct BuiltInNetworkBehaviorConfig {
int delay_standard_deviation_ms = 0;
// Link capacity in kbps.
int link_capacity_kbps = 0;
// Random packet loss.
int loss_percent = 0;
// Random packet loss, range 0 to 100.
double loss_percent = 0.;
// If packets are allowed to be reordered.
bool allow_reordering = false;
// The average length of a burst of lost packets.