macro_rules! graph {
    (
        name: $name:expr,
        label: $label:expr,
        unit: $unit:expr,
        metrics: [$( {$( $metrics:tt )*} ),+ $(,)?] $(,)?
    ) => { ... };
    ($($_:tt)*) => { ... };
}
Expand description

Builds a new Graph.

use mackerel_plugin::graph;

let graph = graph! {
    name: "linux.swap",
    label: "Linux Swap Usage",
    unit: "integer",
    metrics: [
        { name: "pswpin", label: "Swap In", diff: true },
        { name: "pswpout", label: "Swap Out", diff: true },
    ],
};