pub fn performance_span(name: &str, details: &[(&str, &str)]) -> Span
Expand description
Create a tracing span for performance monitoring.
This is useful for tracking the performance of specific operations like data fetching or backtest calculations.
§Arguments
name
- The name of the operation being trackeddetails
- Additional details to include in the span
§Examples
use hyperliquid_backtest::logging::performance_span;
use tracing::Instrument;
async fn fetch_data() -> Result<(), Box<dyn std::error::Error>> {
let span = performance_span("data_fetch", &[("symbol", "BTC"), ("interval", "1h")]);
async {
// Your data fetching logic here
Ok(())
}
.instrument(span)
.await
}