#include "Internal.h" #include #include #include #ifndef PERF_TEST #define PERF_TEST 0 #endif int main(int argc, char **argv) { for (int i = 1; i < argc; ++i) { std::ifstream t(argv[i], std::ios::binary); std::stringstream buffer; buffer << t.rdbuf(); auto str = buffer.str(); TestDriver driver{(const uint8_t *)str.data(), str.size()}; while (!driver.next()) ; if (!driver.ok) { abort(); } ConflictSet::MetricsV1 *metrics; int metricsCount; driver.cs.getMetricsV1(&metrics, &metricsCount); printf("#################### METRICS FOR %s ####################\n", argv[i]); for (int i = 0; i < metricsCount; ++i) { printf("# HELP %s %s\n", metrics[i].name, metrics[i].help); printf("# TYPE %s %s\n", metrics[i].name, metrics[i].type == metrics[i].Counter ? "counter" : "gauge"); printf("%s %g\n", metrics[i].name, metrics[i].getValue()); } puts(""); } }