Skip to main content

fiber_json_types/
prof.rs

1//! Profiling types for the Fiber Network JSON-RPC API.
2
3use crate::serde_utils::U64Hex;
4use serde::{Deserialize, Serialize};
5use serde_with::serde_as;
6
7/// Parameters for profiling.
8#[serde_as]
9#[derive(Serialize, Deserialize, Debug, Clone, Default)]
10pub struct PprofParams {
11    /// Duration to profile in seconds. Defaults 10s.
12    #[serde_as(as = "Option<U64Hex>")]
13    pub duration_secs: Option<u64>,
14}
15
16/// Result of profiling.
17#[derive(Serialize, Deserialize, Debug, Clone)]
18pub struct PprofResult {
19    /// Path of the generated flamegraph SVG.
20    pub path: String,
21}