Skip to main content

spawn_metrics_collector

Function spawn_metrics_collector 

Source
pub fn spawn_metrics_collector<S, C, M>(
    store: Arc<Mutex<S>>,
    docker: C,
    metrics_collector: M,
    config: CollectorConfig,
    shutdown: Receiver<bool>,
) -> JoinHandle<()>
where S: TelemetryStore + Send + 'static, C: DockerClient + Send + Sync + 'static, M: MetricsCollector + Send + Sync + 'static,
Expand description

Spawn a background metrics collector that periodically writes to the store.

Returns a watch::Receiver<CollectionStats> that can be polled for progress and a JoinHandle to the background task.