Expand description

Open Metrics text format implementation.

let mut buffer = String::new();
encode(&mut buffer, &registry).unwrap();

let expected = "# HELP my_counter This is my counter.\n".to_owned() +
               "# TYPE my_counter counter\n" +
               "my_counter_total 1\n" +
               "# EOF\n";
assert_eq!(expected, buffer);

Functions

  • Encode the metrics registered with the provided Registry into the provided Writer using the OpenMetrics text format.