/// Collects a CPU profile for the given `duration` by sampling at the given
/// `frequency`.
Collects a CPU profile for the given `duration` by sampling at the given
`frequency`.
Collects a CPU profile for the given ` duration ` by sampling at the given ` frequency ` .
pub async fn collect(duration: Duration, frequency: i32) -> Result<Report, pprof::Error> {
    let guard = ProfilerGuard::new(frequency)?;
    sleep(duration).await;
    guard
        .report()
        .frames_post_processor(move |frames| {
            frames.thread_name = extract_thread_name(&frames.thread_name);
        })
        .build()
}
pub async fn collect ( duration : Duration , frequency : i32 ) -> Result < Report , pprof :: Error > { let guard = ProfilerGuard :: new ( frequency ) ? ; sleep ( duration ) . await ; guard . report ( ) . frames_post_processor ( move | frames | { frames . thread_name = extract_thread_name ( & frames . thread_name ) ; } ) . build ( ) }
Collects a CPU profile for the given `duration` by sampling at the given
`frequency`.
Collects a CPU profile for the given ` duration ` by sampling at the given ` frequency ` .
duration
Duration
frequency
i32