22#include "util/config/ConfigDefinition.hpp"
23#include "util/log/Logger.hpp"
24#include "util/prometheus/Bool.hpp"
25#include "util/prometheus/Label.hpp"
26#include "util/prometheus/Prometheus.hpp"
28#include <boost/signals2/signal.hpp>
29#include <boost/signals2/variadic_signal.hpp>
50 static std::shared_ptr<SystemState>
53 auto state = std::make_shared<SystemState>();
54 state->isStrictReadonly = config.
get<
bool>(
"read_only");
67 "Whether the process is in strict read-only mode"
74 "Whether the process is writing to the database"
81 "Whether etl is loading cache after clio startup"
111 "etl_amendment_blocked",
113 "Whether clio detected an amendment block"
123 "etl_corruption_detected",
125 "Whether clio detected a corruption that needs manual attention"
141 "etl_writing_deciding_fallback",
143 "Whether the cluster is using the fallback writer decision mechanism"
static util::prometheus::Bool boolMetric(std::string name, util::prometheus::Labels labels, std::optional< std::string > description=std::nullopt)
Get a bool based metric. It will be created if it doesn't exist.
Definition Prometheus.cpp:194
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:50
T get(std::string_view fullKey) const
Returns the specified value of given string if value exists.
Definition ConfigDefinition.hpp:104
Class representing a collection of Prometheus labels.
Definition Label.hpp:59
static std::shared_ptr< SystemState > makeSystemState(util::config::ClioConfigDefinition const &config)
Factory method to create a SystemState instance.
Definition SystemState.hpp:51
util::prometheus::Bool isAmendmentBlocked
Whether clio detected an amendment block.
Definition SystemState.hpp:110
WriteCommand
Commands for controlling the ETL writer state.
Definition SystemState.hpp:89
@ StopWriting
Definition SystemState.hpp:91
@ StartWriting
Definition SystemState.hpp:90
util::prometheus::Bool isCorruptionDetected
Whether clio detected a corruption that needs manual attention.
Definition SystemState.hpp:122
boost::signals2::signal< void(WriteCommand)> writeCommandSignal
Signal for coordinating ETL writer state transitions.
Definition SystemState.hpp:101
util::prometheus::Bool isStrictReadonly
Whether the process is in strict read-only mode.
Definition SystemState.hpp:64
util::prometheus::Bool isWriting
Whether the process is writing to the database.
Definition SystemState.hpp:71
util::prometheus::Bool isWriterDecidingFallback
Whether the cluster is using the fallback writer decision mechanism.
Definition SystemState.hpp:140
util::prometheus::Bool isLoadingCache
Whether the process is still loading cache after startup.
Definition SystemState.hpp:78