![]() |
Project
|
Helper struct to hold statistics about the data processing happening. More...
#include <DataProcessingStats.h>
Classes | |
struct | Command |
struct | CommandSpec |
struct | DefaultConfig |
struct | MetricSpec |
struct | UpdateInfo |
Public Types | |
enum struct | Op : char { Nop , Set , SetIfPositive , CumulativeRate , InstantaneousRate , Add , Sub , Max , Min } |
enum struct | Kind : char { Int , UInt64 , Double , Rate , Unknown } |
enum struct | Scope : char { DPL , Online } |
Public Member Functions | |
DataProcessingStats (std::function< void(int64_t &base, int64_t &offset)> getRealtimeBase, std::function< int64_t(int64_t base, int64_t offset)> getTimestamp, DefaultConfig config) | |
void | registerMetric (MetricSpec const &spec) |
void | updateStats (CommandSpec cmd) |
void | processCommandQueue () |
void | flushChangedMetrics (std::function< void(MetricSpec const &, int64_t, int64_t)> const &callback) |
void | lapseTelemetry () |
Public Attributes | |
DefaultConfig | config = {} |
std::atomic< size_t > | statesSize = 0 |
std::array< Command, MAX_CMDS > | cmds = {} |
std::array< int64_t, MAX_METRICS > | metrics = {} |
std::array< bool, MAX_METRICS > | updated = {} |
std::array< std::string, MAX_METRICS > | metricsNames = {} |
std::array< UpdateInfo, MAX_METRICS > | updateInfos = {} |
std::array< MetricSpec, MAX_METRICS > | metricSpecs = {} |
std::array< int64_t, MAX_METRICS > | lastPublishedMetrics = {} |
std::vector< int > | availableMetrics |
std::atomic< int > | insertedCmds = 0 |
std::atomic< int > | nextCmd = 0 |
std::atomic< int > | pendingCmds = 0 |
int64_t | lastFlushedToRemote = 0 |
int64_t | lastMetrics = 0 |
std::mutex | mMutex |
std::function< void(int64_t &base, int64_t &offset)> | getRealtimeBase |
std::function< int64_t(int64_t base, int64_t offset)> | getTimestamp |
int64_t | realTimeBase = 0 |
int64_t | initialTimeOffset = 0 |
std::atomic< int64_t > | updatedMetricsLapse = 0 |
int64_t | updatedMetricsTotal = 0 |
int64_t | pushedMetricsTotal = 0 |
int64_t | pushedMetricsLapse = 0 |
int64_t | publishedMetricsTotal = 0 |
int64_t | publishedMetricsLapse = 0 |
int64_t | publishingInvokedTotal = 0 |
int64_t | publishingDoneTotal = 0 |
Static Public Attributes | |
static constexpr ServiceKind | service_kind = ServiceKind::Global |
static constexpr unsigned short | MAX_METRICS = 1 << 15 |
static constexpr short | MAX_CMDS = 64 |
Helper struct to hold statistics about the data processing happening.
Definition at line 72 of file DataProcessingStats.h.
|
strong |
Enumerator | |
---|---|
Int | |
UInt64 | |
Double | |
Rate | |
Unknown | A rate metric is sent out as a float and reset to 0 after each update Use the InstantaneousRate operation to update it. Most likely you also want that the minPublishInterval is as large as the maxRefreshLatency. |
Definition at line 101 of file DataProcessingStats.h.
|
strong |
Definition at line 88 of file DataProcessingStats.h.
|
strong |
Enumerator | |
---|---|
DPL | |
Online |
Definition at line 113 of file DataProcessingStats.h.
o2::framework::DataProcessingStats::DataProcessingStats | ( | std::function< void(int64_t &base, int64_t &offset)> | getRealtimeBase, |
std::function< int64_t(int64_t base, int64_t offset)> | getTimestamp, | ||
DefaultConfig | config | ||
) |
Definition at line 22 of file DataProcessingStats.cxx.
void o2::framework::DataProcessingStats::flushChangedMetrics | ( | std::function< void(MetricSpec const &, int64_t, int64_t)> const & | callback | ) |
Definition at line 193 of file DataProcessingStats.cxx.
|
inline |
Definition at line 213 of file DataProcessingStats.h.
void o2::framework::DataProcessingStats::processCommandQueue | ( | ) |
This will process the queue of commands required to update the stats. It is meant to be called periodically by a single thread.
Definition at line 84 of file DataProcessingStats.cxx.
void o2::framework::DataProcessingStats::registerMetric | ( | MetricSpec const & | spec | ) |
Definition at line 252 of file DataProcessingStats.cxx.
void o2::framework::DataProcessingStats::updateStats | ( | CommandSpec | cmd | ) |
Definition at line 32 of file DataProcessingStats.cxx.
std::vector<int> o2::framework::DataProcessingStats::availableMetrics |
Definition at line 191 of file DataProcessingStats.h.
Definition at line 184 of file DataProcessingStats.h.
DefaultConfig o2::framework::DataProcessingStats::config = {} |
Definition at line 78 of file DataProcessingStats.h.
std::function<void(int64_t& base, int64_t& offset)> o2::framework::DataProcessingStats::getRealtimeBase |
Definition at line 204 of file DataProcessingStats.h.
std::function<int64_t(int64_t base, int64_t offset)> o2::framework::DataProcessingStats::getTimestamp |
Definition at line 206 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::initialTimeOffset = 0 |
Definition at line 210 of file DataProcessingStats.h.
std::atomic<int> o2::framework::DataProcessingStats::insertedCmds = 0 |
Definition at line 193 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::lastFlushedToRemote = 0 |
Definition at line 198 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::lastMetrics = 0 |
Definition at line 199 of file DataProcessingStats.h.
std::array<int64_t, MAX_METRICS> o2::framework::DataProcessingStats::lastPublishedMetrics = {} |
Definition at line 190 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 86 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 85 of file DataProcessingStats.h.
std::array<int64_t, MAX_METRICS> o2::framework::DataProcessingStats::metrics = {} |
Definition at line 185 of file DataProcessingStats.h.
std::array<std::string, MAX_METRICS> o2::framework::DataProcessingStats::metricsNames = {} |
Definition at line 187 of file DataProcessingStats.h.
std::array<MetricSpec, MAX_METRICS> o2::framework::DataProcessingStats::metricSpecs = {} |
Definition at line 189 of file DataProcessingStats.h.
std::mutex o2::framework::DataProcessingStats::mMutex |
Definition at line 201 of file DataProcessingStats.h.
std::atomic<int> o2::framework::DataProcessingStats::nextCmd = 0 |
Definition at line 195 of file DataProcessingStats.h.
std::atomic<int> o2::framework::DataProcessingStats::pendingCmds = 0 |
Definition at line 197 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::publishedMetricsLapse = 0 |
Definition at line 229 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::publishedMetricsTotal = 0 |
Definition at line 228 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::publishingDoneTotal = 0 |
Definition at line 231 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::publishingInvokedTotal = 0 |
Definition at line 230 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::pushedMetricsLapse = 0 |
Definition at line 227 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::pushedMetricsTotal = 0 |
Definition at line 226 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::realTimeBase = 0 |
Definition at line 208 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 84 of file DataProcessingStats.h.
std::atomic<size_t> o2::framework::DataProcessingStats::statesSize = 0 |
Definition at line 182 of file DataProcessingStats.h.
std::array<bool, MAX_METRICS> o2::framework::DataProcessingStats::updated = {} |
Definition at line 186 of file DataProcessingStats.h.
std::atomic<int64_t> o2::framework::DataProcessingStats::updatedMetricsLapse = 0 |
Definition at line 224 of file DataProcessingStats.h.
int64_t o2::framework::DataProcessingStats::updatedMetricsTotal = 0 |
Definition at line 225 of file DataProcessingStats.h.
std::array<UpdateInfo, MAX_METRICS> o2::framework::DataProcessingStats::updateInfos = {} |
Definition at line 188 of file DataProcessingStats.h.