mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 00:07:21 -06:00
Filter to non-ephemeral flows, and collect flow tracking data a bit better.
This commit is contained in:
parent
f920e8e1f5
commit
0c6ecd3e91
@ -159,6 +159,7 @@ function drawTimeline() {
|
||||
|
||||
for (let i=0; i<asnData.length; i++) {
|
||||
let row = asnData[i];
|
||||
console.log(row);
|
||||
let canvasId = "flowCanvas" + i;
|
||||
|
||||
// Get the canvas context
|
||||
|
@ -32,6 +32,10 @@ pub async fn flow_timeline(Path(asn_id): Path<u32>) -> Json<Vec<FlowTimeline>> {
|
||||
|
||||
let flows = all_flows_for_asn
|
||||
.iter()
|
||||
.filter(|flow| {
|
||||
// Total flow time > 2 seconds
|
||||
flow.1.last_seen - flow.1.start_time > 2_000_000_000
|
||||
})
|
||||
.map(|flow| {
|
||||
|
||||
FlowTimeline {
|
||||
|
@ -284,6 +284,10 @@ impl TimeBuffer {
|
||||
let buffer = self.buffer.lock().unwrap();
|
||||
buffer
|
||||
.iter()
|
||||
.filter(|flow| {
|
||||
// Total flow time > 2 seconds
|
||||
flow.data.1.last_seen - flow.data.1.start_time > 2_000_000_000
|
||||
})
|
||||
.map(|flow| flow.data.2.asn_id.0)
|
||||
.sorted()
|
||||
.dedup_with_count()
|
||||
|
@ -200,7 +200,6 @@ impl ThroughputTracker {
|
||||
get_flowbee_event_count_and_reset();
|
||||
let since_boot = Duration::from(now);
|
||||
let expire = (since_boot - Duration::from_secs(timeout_seconds)).as_nanos() as u64;
|
||||
let zeroed = DownUpOrder::zeroed();
|
||||
|
||||
// Tracker for per-circuit RTT data. We're losing some of the smoothness by sampling
|
||||
// every flow; the idea is to combine them into a single entry for the circuit. This
|
||||
@ -234,6 +233,11 @@ impl ThroughputTracker {
|
||||
if data.tcp_retransmits.up != this_flow.0.tcp_retransmits.up {
|
||||
this_flow.0.retry_times_up.push(data.last_seen);
|
||||
}
|
||||
|
||||
let change_since_last_time = data.bytes_sent.checked_sub_or_zero(this_flow.0.bytes_sent);
|
||||
this_flow.0.throughput_buffer.push(change_since_last_time);
|
||||
println!("{change_since_last_time:?}");
|
||||
|
||||
this_flow.0.last_seen = data.last_seen;
|
||||
this_flow.0.bytes_sent = data.bytes_sent;
|
||||
this_flow.0.packets_sent = data.packets_sent;
|
||||
@ -242,8 +246,12 @@ impl ThroughputTracker {
|
||||
this_flow.0.end_status = data.end_status;
|
||||
this_flow.0.tos = data.tos;
|
||||
this_flow.0.flags = data.flags;
|
||||
let prev_bytes = this_flow.0.throughput_buffer.last().unwrap_or(&zeroed);
|
||||
this_flow.0.throughput_buffer.push(data.bytes_sent.checked_sub_or_zero(*prev_bytes));
|
||||
|
||||
|
||||
|
||||
//let prev_bytes = this_flow.0.throughput_buffer.last().unwrap_or(&zeroed);
|
||||
//this_flow.0.throughput_buffer.push(data.bytes_sent.checked_sub_or_zero(*prev_bytes));
|
||||
|
||||
if let Some([up, down]) = rtt_samples.get(&key) {
|
||||
if up.as_nanos() != 0 {
|
||||
this_flow.0.rtt[0] = *up;
|
||||
|
Loading…
Reference in New Issue
Block a user