refactor(irtt-stats): extract IPDV update recording
This commit is contained in:
1 file changed
+11
-3
@@ -351,7 +351,15 @@ impl CoreStats {
|
|||||||
self.receive_delay.push_ns(delay);
|
self.receive_delay.push_ns(delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
for pair in self.ipdv_tracker.insert(sample.ipdv) {
|
update.ipdv_pairs = self.apply_ipdv_sample(sample.ipdv);
|
||||||
|
|
||||||
|
update
|
||||||
|
}
|
||||||
|
|
||||||
|
fn apply_ipdv_sample(&mut self, sample: IpdvSample) -> Vec<IpdvPairUpdate> {
|
||||||
|
let mut updates = Vec::new();
|
||||||
|
|
||||||
|
for pair in self.ipdv_tracker.insert(sample) {
|
||||||
let Some(rtt_ipdv) = duration_from_non_negative_i128_ns(pair.rtt_ipdv_ns) else {
|
let Some(rtt_ipdv) = duration_from_non_negative_i128_ns(pair.rtt_ipdv_ns) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
@@ -372,7 +380,7 @@ impl CoreStats {
|
|||||||
self.ipdv_receive.push_ns(value);
|
self.ipdv_receive.push_ns(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
update.ipdv_pairs.push(IpdvPairUpdate {
|
updates.push(IpdvPairUpdate {
|
||||||
previous_seq: pair.previous_seq,
|
previous_seq: pair.previous_seq,
|
||||||
current_seq: pair.current_seq,
|
current_seq: pair.current_seq,
|
||||||
rtt_ipdv,
|
rtt_ipdv,
|
||||||
@@ -381,7 +389,7 @@ impl CoreStats {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
update
|
updates
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_duplicate_reply(&mut self) {
|
fn apply_duplicate_reply(&mut self) {
|
||||||
|
|||||||
Reference in new issue
Block a user