Merge remote-tracking branch 'upstream/master' into split-buildRemote
This commit is contained in:
@@ -6,12 +6,18 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <regex>
|
||||
|
||||
#include <prometheus/counter.h>
|
||||
#include <prometheus/gauge.h>
|
||||
#include <prometheus/registry.h>
|
||||
|
||||
#include "db.hh"
|
||||
|
||||
#include "parsed-derivations.hh"
|
||||
#include "pathlocks.hh"
|
||||
#include "pool.hh"
|
||||
#include "build-result.hh"
|
||||
#include "store-api.hh"
|
||||
#include "sync.hh"
|
||||
#include "nar-extractor.hh"
|
||||
@@ -290,7 +296,8 @@ struct Machine
|
||||
|
||||
bool isLocalhost()
|
||||
{
|
||||
return sshName == "localhost";
|
||||
std::regex r("^(ssh://|ssh-ng://)?localhost$");
|
||||
return std::regex_search(sshName, r);
|
||||
}
|
||||
|
||||
// A connection to a machine
|
||||
@@ -444,8 +451,25 @@ private:
|
||||
via gc_roots_dir. */
|
||||
nix::Path rootsDir;
|
||||
|
||||
std::string metricsAddr;
|
||||
|
||||
struct PromMetrics
|
||||
{
|
||||
std::shared_ptr<prometheus::Registry> registry;
|
||||
|
||||
prometheus::Counter& queue_checks_started;
|
||||
prometheus::Counter& queue_build_loads;
|
||||
prometheus::Counter& queue_steps_created;
|
||||
prometheus::Counter& queue_checks_early_exits;
|
||||
prometheus::Counter& queue_checks_finished;
|
||||
prometheus::Gauge& queue_max_id;
|
||||
|
||||
PromMetrics();
|
||||
};
|
||||
PromMetrics prom;
|
||||
|
||||
public:
|
||||
State();
|
||||
State(std::optional<std::string> metricsAddrOpt);
|
||||
|
||||
struct BuildOptions {
|
||||
unsigned int maxSilentTime, buildTimeout, repeats;
|
||||
@@ -560,6 +584,8 @@ private:
|
||||
|
||||
void addRoot(const nix::StorePath & storePath);
|
||||
|
||||
void runMetricsExporter();
|
||||
|
||||
public:
|
||||
|
||||
void showStatus();
|
||||
|
Reference in New Issue
Block a user