From a71412e2021875d1a20a5d965a6cea2a5e117e98 Mon Sep 17 00:00:00 2001 From: liuchao Date: Tue, 5 Dec 2023 11:12:29 +0800 Subject: [PATCH] Repair service ratio is negative --- app/app/application/l7_flow_tracing.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/app/application/l7_flow_tracing.py b/app/app/application/l7_flow_tracing.py index bb60f12..eebd308 100644 --- a/app/app/application/l7_flow_tracing.py +++ b/app/app/application/l7_flow_tracing.py @@ -1397,12 +1397,10 @@ def format_selftime(traces, parent_trace, child_ids, uid_index_map): child_trace = traces[uid_index_map[child_id]] child_self_time = child_trace["end_time_us"] - child_trace[ "start_time_us"] - if child_self_time > 0: + if child_self_time > 0 and child_self_time <= parent_trace["selftime"]: parent_trace["selftime"] -= child_self_time else: - new_child_ids = child_trace.get("childs", []) - return format_selftime(traces, parent_trace, new_child_ids, - uid_index_map) + return def pruning_trace(response, _id, network_delay_us):