![]() |
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) |
| char const * | findMetricNameById (ProcessingStatsId id) const |
| 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 |
| bool | hasAvailSHMMetric = false |
| 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 76 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 105 of file DataProcessingStats.h.
|
strong |
Definition at line 92 of file DataProcessingStats.h.
|
strong |
| Enumerator | |
|---|---|
| DPL | |
| Online | |
Definition at line 117 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.
| char const * o2::framework::DataProcessingStats::findMetricNameById | ( | ProcessingStatsId | id | ) | const |
Definition at line 32 of file DataProcessingStats.cxx.
| void o2::framework::DataProcessingStats::flushChangedMetrics | ( | std::function< void(MetricSpec const &, int64_t, int64_t)> const & | callback | ) |
Definition at line 203 of file DataProcessingStats.cxx.
|
inline |
Definition at line 221 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 94 of file DataProcessingStats.cxx.
| void o2::framework::DataProcessingStats::registerMetric | ( | MetricSpec const & | spec | ) |
Definition at line 262 of file DataProcessingStats.cxx.
| void o2::framework::DataProcessingStats::updateStats | ( | CommandSpec | cmd | ) |
Definition at line 42 of file DataProcessingStats.cxx.
| std::vector<int> o2::framework::DataProcessingStats::availableMetrics |
Definition at line 197 of file DataProcessingStats.h.
Definition at line 190 of file DataProcessingStats.h.
| DefaultConfig o2::framework::DataProcessingStats::config = {} |
Definition at line 82 of file DataProcessingStats.h.
| std::function<void(int64_t& base, int64_t& offset)> o2::framework::DataProcessingStats::getRealtimeBase |
Definition at line 212 of file DataProcessingStats.h.
| std::function<int64_t(int64_t base, int64_t offset)> o2::framework::DataProcessingStats::getTimestamp |
Definition at line 214 of file DataProcessingStats.h.
| bool o2::framework::DataProcessingStats::hasAvailSHMMetric = false |
Definition at line 199 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::initialTimeOffset = 0 |
Definition at line 218 of file DataProcessingStats.h.
| std::atomic<int> o2::framework::DataProcessingStats::insertedCmds = 0 |
Definition at line 201 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::lastFlushedToRemote = 0 |
Definition at line 206 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::lastMetrics = 0 |
Definition at line 207 of file DataProcessingStats.h.
| std::array<int64_t, MAX_METRICS> o2::framework::DataProcessingStats::lastPublishedMetrics = {} |
Definition at line 196 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 90 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 89 of file DataProcessingStats.h.
| std::array<int64_t, MAX_METRICS> o2::framework::DataProcessingStats::metrics = {} |
Definition at line 191 of file DataProcessingStats.h.
| std::array<std::string, MAX_METRICS> o2::framework::DataProcessingStats::metricsNames = {} |
Definition at line 193 of file DataProcessingStats.h.
| std::array<MetricSpec, MAX_METRICS> o2::framework::DataProcessingStats::metricSpecs = {} |
Definition at line 195 of file DataProcessingStats.h.
| std::mutex o2::framework::DataProcessingStats::mMutex |
Definition at line 209 of file DataProcessingStats.h.
| std::atomic<int> o2::framework::DataProcessingStats::nextCmd = 0 |
Definition at line 203 of file DataProcessingStats.h.
| std::atomic<int> o2::framework::DataProcessingStats::pendingCmds = 0 |
Definition at line 205 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::publishedMetricsLapse = 0 |
Definition at line 237 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::publishedMetricsTotal = 0 |
Definition at line 236 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::publishingDoneTotal = 0 |
Definition at line 239 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::publishingInvokedTotal = 0 |
Definition at line 238 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::pushedMetricsLapse = 0 |
Definition at line 235 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::pushedMetricsTotal = 0 |
Definition at line 234 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::realTimeBase = 0 |
Definition at line 216 of file DataProcessingStats.h.
|
staticconstexpr |
Definition at line 88 of file DataProcessingStats.h.
| std::atomic<size_t> o2::framework::DataProcessingStats::statesSize = 0 |
Definition at line 188 of file DataProcessingStats.h.
| std::array<bool, MAX_METRICS> o2::framework::DataProcessingStats::updated = {} |
Definition at line 192 of file DataProcessingStats.h.
| std::atomic<int64_t> o2::framework::DataProcessingStats::updatedMetricsLapse = 0 |
Definition at line 232 of file DataProcessingStats.h.
| int64_t o2::framework::DataProcessingStats::updatedMetricsTotal = 0 |
Definition at line 233 of file DataProcessingStats.h.
| std::array<UpdateInfo, MAX_METRICS> o2::framework::DataProcessingStats::updateInfos = {} |
Definition at line 194 of file DataProcessingStats.h.