11 return {0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 20};
17 : registry_(std::make_shared<prometheus::Registry>()),
18 age_seconds_(prometheus::BuildHistogram()
19 .
Name(
"nanommo_bot_world_age_seconds")
20 .Help(
"How old each bot's newest world is")
22 .Add({{
"transport", transport}},
23 prometheus::Histogram::BucketBoundaries{
24 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08,
25 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16,
26 0.17, 0.18, 0.19, 0.2, 0.25, 0.3, 0.4, 0.5,
27 0.75, 1, 1.5, 2, 2.5, 3, 4, 5,
28 6, 8, 10, 15, 20, 30})),
29 connected_(prometheus::BuildGauge()
30 .
Name(
"nanommo_bots_connected")
31 .Help(
"How many bots are connected to a world")
33 .Add({{
"transport", transport}})),
34 logins_(prometheus::BuildHistogram()
35 .
Name(
"nanommo_bot_login_duration_seconds")
36 .Help(
"How long each bot's login took, by what came of it")
37 .Register(*registry_)) {
38 for (
const char* result : {
"ok",
"refused",
"timeout",
"failed"}) {
39 logins_.Add({{
"result", result}}, LoginBuckets());