async fn report_runtime_stats(
    mut stats_channel: mpsc::UnboundedReceiver<RuntimeStats>,
    heartbeat_client: impl HeartbeatSender,
) -> Result<()> {
    // Cache the last-reported stats for a given worker.
    //
    // When logging stats, the most recently reported runtime stats will be used for any
    // missing data. For time-triggered logging, it will be used for all workers.
    let mut total = TotalStats::default();

    // report all zeros to start
    total.report();

    let timer = Timer::new(RUNTIME_STATS_PERIOD);

    loop {
        tokio::select! {
            Some(stats) = stats_channel.recv() => {
                heartbeat_client.alive();
                total.update(stats);
                total.report()
            }
            _ = timer.wait() => {
                total.report()
            }
        }
    }
}
// Report runtime stats, as delivered via the `stats` channel, with a periodic trigger to
// guarantee a minimum reporting frequency.
//
// The minimum frequency is to aid metric visualization. The libFuzzer binary runtime's `pulse`
// event is triggered by a doubling of the last (locally) logged total iteration count. For long-
// running worker runs, this can result in misleading gaps and binning artifacts. In effect, we
// are approximating nearest-neighbor interpolation on the runtime stats time series.
Report runtime stats, as delivered via the `stats` channel, with a periodic trigger to
guarantee a minimum reporting frequency.

The minimum frequency is to aid metric visualization. The libFuzzer binary runtime's `pulse`
event is triggered by a doubling of the last (locally) logged total iteration count. For long
running worker runs, this can result in misleading gaps and binning artifacts. In effect, we
are approximating nearest-neighbor interpolation on the runtime stats time series.
Report runtime stats as delivered via the ` stats ` channel with a periodic trigger to guarantee a minimum reporting frequency . The minimum frequency is to aid metric visualization . The libFuzzer binary runtime ' s ` pulse ` event is triggered by a doubling of the last ( locally ) logged total iteration count . For long running worker runs this can result in misleading gaps and binning artifacts . In effect we are approximating nearest - neighbor interpolation on the runtime stats time series .
async fn report_runtime_stats(
    mut stats_channel: mpsc::UnboundedReceiver<RuntimeStats>,
    heartbeat_client: impl HeartbeatSender,
) -> Result<()> {
    // Cache the last-reported stats for a given worker.
    //
    // When logging stats, the most recently reported runtime stats will be used for any
    // missing data. For time-triggered logging, it will be used for all workers.
    let mut total = TotalStats::default();
    // report all zeros to start
    total.report();
    let timer = Timer::new(RUNTIME_STATS_PERIOD);
    loop {
        tokio::select! {
            Some(stats) = stats_channel.recv() => {
                heartbeat_client.alive();
                total.update(stats);
                total.report()
            }
            _ = timer.wait() => {
                total.report()
            }
        }
    }
}
async fn report_runtime_stats ( mut stats_channel : mpsc :: UnboundedReceiver < RuntimeStats > , heartbeat_client : impl HeartbeatSender , ) -> Result < ( ) > { // Cache the last-reported stats for a given worker. // // When logging stats, the most recently reported runtime stats will be used for any // missing data. For time-triggered logging, it will be used for all workers. let mut total = TotalStats :: default ( ) ; // report all zeros to start total . report ( ) ; let timer = Timer :: new ( RUNTIME_STATS_PERIOD ) ; loop { tokio :: select ! { Some ( stats ) stats_channel recv ( ) { heartbeat_client alive ( ) total update ( stats ) total report ( ) } timer wait ( ) { total report ( ) } } } }
Report runtime stats, as delivered via the `stats` channel, with a periodic trigger to
guarantee a minimum reporting frequency.
Report runtime stats as delivered via the ` stats ` channel with a periodic trigger to guarantee a minimum reporting frequency .
stats_channel
mpsc::UnboundedReceiver<RuntimeStats>
heartbeat_client
impl HeartbeatSender
stats_channel
mpsc::UnboundedReceiver<RuntimeStats>
heartbeat_client
impl HeartbeatSender