forked from lix-project/hydra
bring back the working version Cole made
This commit is contained in:
parent
5bff730f2c
commit
46f52b4c4e
|
@ -49,20 +49,12 @@ State::State(std::optional<std::string> metricsAddrOpt)
|
||||||
, rootsDir(config->getStrOption("gc_roots_dir", fmt("%s/gcroots/per-user/%s/hydra-roots", settings.nixStateDir, getEnvOrDie("LOGNAME"))))
|
, rootsDir(config->getStrOption("gc_roots_dir", fmt("%s/gcroots/per-user/%s/hydra-roots", settings.nixStateDir, getEnvOrDie("LOGNAME"))))
|
||||||
, metricsAddr(config->getStrOption("queue_runner_metrics_address", std::string{"127.0.0.1:9198"}))
|
, metricsAddr(config->getStrOption("queue_runner_metrics_address", std::string{"127.0.0.1:9198"}))
|
||||||
, registry(std::make_shared<prometheus::Registry>())
|
, registry(std::make_shared<prometheus::Registry>())
|
||||||
// , call_ctr_family(prometheus::BuildCounter().Name("queue_queued_builds_calls_total").Help("Number of times State::getQueuedBuilds() was called").Register(*registry))
|
, call_ctr(prometheus::BuildCounter()
|
||||||
// , call_ctr(call_ctr_family.Add({}))
|
.Name("queue_queued_builds_calls_total")
|
||||||
|
.Help("Number of times State::getQueuedBuilds() was called")
|
||||||
|
.Register(*registry))
|
||||||
|
, queue_queued_builds_calls(call_ctr.Add({})) // FIXME: add the proper arguments
|
||||||
{
|
{
|
||||||
// call_ctr_family(prometheus::BuildCounter().Name("queue_queued_builds_calls_total").Help("Number of times State::getQueuedBuilds() was called").Register(*registry));
|
|
||||||
// call_ctr(call_ctr_family.Add({}));
|
|
||||||
auto& fam = prometheus::BuildCounter()
|
|
||||||
.Name("queue_queued_builds_calls_total")
|
|
||||||
.Help("Number of times State::getQueuedBuilds() was called")
|
|
||||||
.Register(*registry)
|
|
||||||
.Add({});
|
|
||||||
|
|
||||||
// call_ctr_family(fam);
|
|
||||||
// call_ctr(call_ctr_family.Add({}));
|
|
||||||
|
|
||||||
hydraData = getEnvOrDie("HYDRA_DATA");
|
hydraData = getEnvOrDie("HYDRA_DATA");
|
||||||
|
|
||||||
logDir = canonPath(hydraData + "/build-logs");
|
logDir = canonPath(hydraData + "/build-logs");
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct PreviousFailure : public std::exception {
|
||||||
bool State::getQueuedBuilds(Connection & conn,
|
bool State::getQueuedBuilds(Connection & conn,
|
||||||
ref<Store> destStore, unsigned int & lastBuildId)
|
ref<Store> destStore, unsigned int & lastBuildId)
|
||||||
{
|
{
|
||||||
call_ctr.Increment();
|
queue_queued_builds_calls.Increment();
|
||||||
|
|
||||||
printInfo("checking the queue for builds > %d...", lastBuildId);
|
printInfo("checking the queue for builds > %d...", lastBuildId);
|
||||||
|
|
||||||
|
|
|
@ -439,8 +439,8 @@ private:
|
||||||
|
|
||||||
std::shared_ptr<prometheus::Registry> registry;
|
std::shared_ptr<prometheus::Registry> registry;
|
||||||
|
|
||||||
// prometheus::Family<prometheus::Counter>& call_ctr_family;
|
prometheus::Family<prometheus::Counter>& call_ctr;
|
||||||
prometheus::Counter& call_ctr;
|
prometheus::Counter& queue_queued_builds_calls;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
State(std::optional<std::string> metricsAddrOpt);
|
State(std::optional<std::string> metricsAddrOpt);
|
||||||
|
|
Loading…
Reference in a new issue