openmetrics-parser 0.4.4

An OpenMetrics/Prometheus Text Exposition Format Parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fs;

use super::parsers::parse_prometheus;

#[test]
fn test_prometheus_parser() {
    for file in fs::read_dir("./src/prometheus/testdata").unwrap() {
        let file = file.unwrap();
        let path = file.path();
        if path.extension().unwrap() == "txt" {
            let child_str = fs::read_to_string(&path).unwrap();
            let result = parse_prometheus(&child_str);
            assert!(result.is_ok(), "failed to parse {}: {}", path.display(), result.err().unwrap());
        }
    }
}