|
xrpld
|
State accounting records two attributes for each possible server state: 1) Amount of time spent in each state (in microseconds). More...

Classes | |
| struct | Counters |
| struct | CounterData |
Public Member Functions | |
| StateAccounting () | |
| void | mode (OperatingMode om) |
| Record state transition. | |
| void | json (json::Value &obj) const |
| Output state counters in JSON format. | |
| CounterData | getCounterData () const |
Private Attributes | |
| OperatingMode | mode_ = OperatingMode::DISCONNECTED |
| std::array< Counters, 5 > | counters_ |
| std::mutex | mutex_ |
| std::chrono::steady_clock::time_point | start_ = std::chrono::steady_clock::now() |
| std::chrono::steady_clock::time_point const | processStart_ = start_ |
| std::uint64_t | initialSyncUs_ {0} |
Static Private Attributes | |
| static std::array< json::StaticString const, 5 > const | kStates |
State accounting records two attributes for each possible server state: 1) Amount of time spent in each state (in microseconds).
This value is updated upon each state transition. 2) Number of transitions to each state.
This data can be polled through server_info and represented by monitoring systems similarly to how bandwidth, CPU, and other counter-based metrics are managed.
State accounting is more accurate than periodic sampling of server state. With periodic sampling, it is very likely that state transitions are missed, and accuracy of time spent in each state is very rough.
Definition at line 214 of file NetworkOPs.cpp.
|
explicit |
Definition at line 233 of file NetworkOPs.cpp.
| void xrpl::NetworkOPsImp::StateAccounting::mode | ( | OperatingMode | om | ) |
Record state transition.
Update duration spent in previous state.
| om | New state. |
Definition at line 5129 of file NetworkOPs.cpp.
| void xrpl::NetworkOPsImp::StateAccounting::json | ( | json::Value & | obj | ) | const |
Output state counters in JSON format.
@obj Json object to which to add state accounting data.
Definition at line 5148 of file NetworkOPs.cpp.
| CounterData xrpl::NetworkOPsImp::StateAccounting::getCounterData | ( | ) | const |
Definition at line 264 of file NetworkOPs.cpp.
|
private |
Definition at line 224 of file NetworkOPs.cpp.
|
private |
Definition at line 225 of file NetworkOPs.cpp.
|
mutableprivate |
Definition at line 226 of file NetworkOPs.cpp.
|
private |
Definition at line 227 of file NetworkOPs.cpp.
|
private |
Definition at line 228 of file NetworkOPs.cpp.
|
private |
Definition at line 229 of file NetworkOPs.cpp.
|
staticprivate |
Definition at line 230 of file NetworkOPs.cpp.