Files
moloapp/tests/example/metrics/counters_test.cpp
T
retoor 3c4334cec9 feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security,
data, app, realtime, supervisor, clients, CLI, example plus
enterprise tenancy, audit, operability, governance,
supplychain. Postgres via docker compose for tests.
2026-10-23 18:20:04 +02:00

16 lines
491 B
C++

// Route: GET /metrics/counters (prometheus render)
#include "support/Assert.hpp"
using namespace molo::example::test;
int main() {
Fixture f;
auto first = f.client->get("/metrics/counters");
check(first.status == 200, "status 200");
check(contains(first.body, "example.page.views 1"), "counter at 1");
f.client->get("/metrics/counters");
check(f.services.metrics->get("example.page.views") == 2.0,
"side effect: counter at 2");
return finish("metrics/counters");
}