Test collecting populated stats, but without any label.
auto expected = "up_time_s 3600\ncount 347\nratio 3.14\nfraction 6.023\n" ~ "very_real 0.43\n"; mstring actual; formatStats(Statistics(3600, 347, 3.14, 6.023, 0.43), actual); test!("==")(actual, expected);
Test collecting populated stats with one label
auto expected = "up_time_s {id=\"123.034\"} 3600\ncount {id=\"123.034\"} 347\n" ~ "ratio {id=\"123.034\"} 3.14\nfraction {id=\"123.034\"} 6.023\n" ~ "very_real {id=\"123.034\"} 0.43\n"; mstring actual; formatStats!("id")( Statistics(3600, 347, 3.14, 6.023, 0.43), 123.034, actual); test!("==")(actual, expected);
Test collecting stats having initial values with multiple labels
auto expected = "up_time_s {id=\"1235813\",job=\"ocean\",perf=\"3.14159\"} 3600\n" ~ "count {id=\"1235813\",job=\"ocean\",perf=\"3.14159\"} 347\n" ~ "ratio {id=\"1235813\",job=\"ocean\",perf=\"3.14159\"} 3.14\n" ~ "fraction {id=\"1235813\",job=\"ocean\",perf=\"3.14159\"} 6.023\n" ~ "very_real {id=\"1235813\",job=\"ocean\",perf=\"3.14159\"} 0.43\n"; mstring actual; formatStats(Statistics(3600, 347, 3.14, 6.023, 0.43), Labels(1_235_813, "ocean", 3.14159), actual); test!("==")(actual, expected);