"fix" panic

This commit is contained in:
Louis Dureuil 2024-07-30 11:26:02 +02:00
parent be9b1f9c4b
commit c3e5ac1b74
No known key found for this signature in database

View File

@ -113,11 +113,17 @@ pub fn to_call_stats<R: std::io::Read>(
let span = *span; let span = *span;
if let Some(parent_id) = span.parent_id { if let Some(parent_id) = span.parent_id {
let (_, _, parent_self_time) = spans.get_mut(&parent_id).unwrap(); let Some((_, _, parent_self_time)) = spans.get_mut(&parent_id) else {
tracing::warn!("could not find referenced parent span");
continue;
};
parent_self_time.add_child_range(self_range.clone()) parent_self_time.add_child_range(self_range.clone())
} }
total_self_time.add_child_range(self_range); total_self_time.add_child_range(self_range);
let (_, call_list) = calls.get_mut(&span.call_id).unwrap(); let Some((_, call_list)) = calls.get_mut(&span.call_id) else {
tracing::warn!("could not find referenced call");
continue;
};
call_list.push((end - begin, self_duration)); call_list.push((end - begin, self_duration));
} }
Entry::SpanClose(SpanClose { id, time: _ }) => { Entry::SpanClose(SpanClose { id, time: _ }) => {