Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
SystemState.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2023, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "util/prometheus/Bool.hpp"
23#include "util/prometheus/Label.hpp"
24#include "util/prometheus/Prometheus.hpp"
25
26#include <atomic>
27
28namespace etl {
29
41 "read_only",
43 "Whether the process is in strict read-only mode"
44 );
45
48 "etl_writing",
50 "Whether the process is writing to the database"
51 );
52
53 std::atomic_bool isStopping = false;
54 std::atomic_bool writeConflict = false;
64 "etl_amendment_blocked",
66 "Whether clio detected an amendment block"
67 );
68
76 "etl_corruption_detected",
78 "Whether clio detected a corruption that needs manual attention"
79 );
80};
81
82} // namespace etl
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:188
A wrapped to provide bool interface for a Prometheus metric.
Definition Bool.hpp:41
Class representing a collection of Prometheus labels.
Definition Label.hpp:59
This namespace contains everything to do with the ETL and ETL sources.
Definition CacheLoader.hpp:36
Represents the state of the ETL subsystem.
Definition SystemState.hpp:33
std::atomic_bool writeConflict
Whether a write conflict was detected.
Definition SystemState.hpp:54
util::prometheus::Bool isAmendmentBlocked
Whether clio detected an amendment block.
Definition SystemState.hpp:63
util::prometheus::Bool isReadOnly
Whether the process is in strict read-only mode.
Definition SystemState.hpp:40
std::atomic_bool isStopping
Whether the software is stopping.
Definition SystemState.hpp:53
util::prometheus::Bool isCorruptionDetected
Whether clio detected a corruption that needs manual attention.
Definition SystemState.hpp:75
util::prometheus::Bool isWriting
Whether the process is writing to the database.
Definition SystemState.hpp:47