8 releases

0.3.0 Jul 20, 2020
0.2.0 Oct 19, 2019
0.1.5 Jul 11, 2019
0.1.4 May 28, 2019
0.1.1 Mar 29, 2019

#7 in #spirit

28 downloads per month

Apache-2.0 OR MIT

3.5K SLoC


Travis Build Status

A helper to auto-configure dipstick backend. It is part of the spirit system.

See the docs and the examples.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


Configuration support for the [dipstick] metrics library.

This provides a configuration [Fragment] for the [spirit] family of libraries. It configures the „backend“ part of the library ‒ the part that sends the metrics somewhere, like to statsd or a file.


use dipstick::{stats_all, InputScope};
use serde::Deserialize;
use spirit::{Empty, Pipeline, Spirit};
use spirit::prelude::*;
use spirit_dipstick::{Config as MetricsConfig, Monitor};

#[derive(Debug, Default, Deserialize)]
struct Cfg {
    metrics: MetricsConfig,

impl Cfg {
   fn metrics(&self) -> &MetricsConfig {

const CFG: &str = r#"
prefix = "example" # If omitted, the name of the application is used
flush-period = "5s"  # Dump metric statistics every 5 seconds
backends = [
    { type = "file", filename = "/tmp/metrics.txt" },
    { type = "stdout" },

fn main() {
   let root = Monitor::new();

    Spirit::<Empty, Cfg>::new()
       .run(move |_| {
           let counter = root.counter("looped");


~121K SLoC