1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! A fast and modular metrics library decoupling app instrumentation from reporting backend.
//! Similar to popular logging frameworks, but with counters and timers.
//! Can be configured for combined outputs (log + statsd), random sampling, local aggregation
//! of metrics, recurrent background publication, etc.

#![cfg_attr(feature = "bench", feature(test))]

#![warn(
missing_copy_implementations,
//missing_debug_implementations,
missing_docs,
trivial_casts,
trivial_numeric_casts,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
// variant_size_differences,
)]

#[cfg(feature = "bench")]
extern crate test;

#[macro_use]
extern crate log as log_crate; // avoid namespace conflict with local 'log' module

#[macro_use]
extern crate error_chain;

extern crate time;
extern crate cached;
extern crate num;

mod pcg32;

mod error {
    //! Dipstick uses error_chain to handle the critical errors that might crop up when assembling the backend.
    error_chain! {
        foreign_links {
            Io(::std::io::Error);
        }
    }
}

pub mod core;
pub mod macros;
pub mod output;
pub mod app;

pub mod sampling;
pub mod aggregate;
pub mod publish;
pub mod statsd;
pub mod cache;
pub mod multi;
pub mod queue;
pub mod fnsink;

// input
pub use app::metrics;

// generic
pub use fnsink::make_sink;

// buffering
pub use queue::queue;

// transform
pub use cache::cache;
pub use sampling::sample;

// pack + forward
pub use aggregate::aggregate;
pub use publish::{publish, publish_every};

// output
pub use output::{log, print};
pub use statsd::statsd;