hydra-queue-runner: make registry member of State, configurable metrics port

Thanks to the updated prometheus-cpp library, specifying a port of 0
will cause it to pick a random (available) port -- ideal for tests.
This commit is contained in:
Cole Helbling
2022-03-11 11:52:43 -08:00
parent 6e6475d860
commit 52a29d43e6
2 changed files with 31 additions and 23 deletions

View File

@@ -7,6 +7,8 @@
#include <memory>
#include <queue>
#include <prometheus/registry.h>
#include "db.hh"
#include "parsed-derivations.hh"
@@ -432,8 +434,12 @@ private:
via gc_roots_dir. */
nix::Path rootsDir;
std::shared_ptr<prometheus::Registry> registry;
uint16_t metricsPort;
public:
State();
State(uint16_t metricsPort);
private: