spanstats: change field names

This commit is contained in:
Louis Dureuil 2024-02-05 17:38:50 +01:00
parent bc097d90cb
commit d78ada07b5
No known key found for this signature in database

View File

@ -14,8 +14,8 @@ enum SpanStatus {
#[derive(Serialize, Deserialize)]
pub struct CallStats {
pub nb: usize,
pub ns: u64,
pub call_count: usize,
pub time: u64,
}
pub fn to_call_stats<R: std::io::Read>(
@ -75,5 +75,5 @@ fn site_to_string(call_site: NewCallsite) -> String {
fn calls_to_stats(calls: Vec<Duration>) -> CallStats {
let nb = calls.len();
let sum: Duration = calls.iter().sum();
CallStats { nb, ns: sum.as_nanos() as u64 }
CallStats { call_count: nb, time: sum.as_nanos() as u64 }
}