|
MetroCollect
2.3.4
|
Class to control the collection of metrics. More...
#include <MetricsController.h>

Classes | |
| struct | MetricsStats |
| Struct to store all final metric stats. More... | |
| struct | MetricsStatsIntermediate |
| Struct to store all intermediate metric stats. More... | |
Public Member Functions | |
| MetricsController (MetricsControllerDelegate &delegate) noexcept | |
| Construct a new Metrics Controller object. More... | |
| MetricsControllerDelegate & | delegate () const noexcept |
| Returns the controller's delegate. More... | |
| bool | isCollecting () const noexcept |
| Returns whether the controller is collecting metrics. More... | |
| bool | sendValues () const noexcept |
| Returns whether the controller alerts the delegate after collecting new values. More... | |
| bool | sendStats () const noexcept |
| Returns whether the controller alerts the delegate after computing statistics. More... | |
| const std::vector< size_t > & | requestedMetrics () const noexcept |
| Returns the list of request metrics. More... | |
| std::chrono::milliseconds | samplingInterval () const noexcept |
| Returns the metrics sampling interval. More... | |
| size_t | processingWindowLength () const noexcept |
| Returns the length of the processing window used to compute statistics. More... | |
| size_t | processingWindowOverlap () const noexcept |
| Returns the overlap of the processing window used to compute statistics. More... | |
| bool | convertToUnitsPerSeconds () const noexcept |
| Returns whether to convert metric differences to units per second. More... | |
| void | setSendValues (bool sendValues) noexcept |
| Sets whether the controller alerts the delegate after collecting new values. More... | |
| void | setSendStats (bool sendStats) noexcept |
| Sets whether the controller alerts the delegate after computing statistics. More... | |
| void | setRequestedMetrics (const MetricsArray< Statistics::Stats > &requestedMetrics) noexcept |
| Sets the list of request metrics. More... | |
| void | setSamplingInterval (std::chrono::milliseconds interval) noexcept |
| Sets the metrics sampling interval. More... | |
| void | setProcessingWindow (size_t length, size_t overlap) noexcept |
| Sets the processing window parameters used to compute statistics. More... | |
| void | setConvertToUnitsPerSeconds (bool convertToUnitsPerSecond) noexcept |
| Sets whether to convert metric differences to units per second. More... | |
| void | collectMetrics () |
| Launch metric collection loop. More... | |
| bool | isMetricNull (size_t index) const |
| Checks wether a metric is zero. More... | |
Static Public Attributes | |
| static constexpr bool | defaultSendValues = false |
| Default parameter option. More... | |
| static constexpr bool | defaultSendStats = false |
| Default parameter option. More... | |
| static constexpr std::chrono::milliseconds | defaultSamplingInterval = 100ms |
| Default parameter option. More... | |
| static constexpr size_t | defaultProcessingWindowLength = 10 |
| Default parameter option. More... | |
| static constexpr size_t | defaultProcessingWindowOverlap = 0 |
| Default parameter option. More... | |
| static constexpr bool | defaultConvertToUnitsPerSecond = true |
| Default parameter option. More... | |
Protected Member Functions | |
| void | updateMetrics () |
| Fetch latest metrics from source and compute their variations. More... | |
| void | updateIterativeStats () |
| Update iterative stats with new MetricsDiffArray. More... | |
| void | computeFinalStats () |
| Compute final stats at the end of processing window. More... | |
| void | resetIterativeStats () |
| Reset iterative stats to begin new processing window. More... | |
Protected Attributes | |
| MetricsControllerDelegate & | delegate_ |
| Delegate to alert when something happens. More... | |
| MetricsSource::SourceInterests | sourceInterests_ |
| Boolean arrays to store source interests. More... | |
| std::vector< size_t > | requestedMetrics_ |
| Indexes of metrics requested to be collected. More... | |
| bool | sendValues_ |
| Whether to give values to the delegate. More... | |
| bool | sendStats_ |
| Whether to compute stats and give them to the delegate. More... | |
| bool | isCollecting_ |
| Whether the receiver is collecting metrics. More... | |
| std::chrono::milliseconds | samplingInterval_ |
| Metrics sampling interval. More... | |
| double | unitsPerSecondFactor_ |
| Factor to convert metric differences to units per second. More... | |
| bool | convertToUnitsPerSecond_ |
| Whether to convert metric differences to units per second. More... | |
| size_t | processingWindowLength_ |
| Length of processing window used to compute statistics. More... | |
| size_t | processingWindowOverlap_ |
| Overlap of processing window used to compute statistics. More... | |
| std::unique_ptr< MetricsDataArray > | currentMetrics_ |
| Pointer to latest metric raw values. More... | |
| std::unique_ptr< MetricsDataArray > | previousMetrics_ |
| Pointer to earlier metric raw values. More... | |
| CircularArray::CircularArray< MetricsDiffArray > | metricsValues_ |
| CircularArray holding all metric differences, used to compute statistics. More... | |
| MetricsStatsIntermediate | metricsStatsIntermediate_ |
| Intermediate statistics arrays. More... | |
| MetricsStats | metricsStats_ |
| Final statistics arrays. More... | |
Class to control the collection of metrics.
Definition at line 42 of file MetricsController.h.
|
noexcept |
Construct a new Metrics Controller object.
| delegate | the controller's delegate |
Definition at line 33 of file MetricsController.cc.
| void MetroCollect::MetricsController::collectMetrics | ( | ) |
Launch metric collection loop.
Definition at line 176 of file MetricsController.cc.


|
protected |
Compute final stats at the end of processing window.
Definition at line 264 of file MetricsController.cc.


|
noexcept |
Returns whether to convert metric differences to units per second.
Definition at line 84 of file MetricsController.cc.
|
noexcept |
Returns the controller's delegate.
Definition at line 50 of file MetricsController.cc.
|
noexcept |
Returns whether the controller is collecting metrics.
Definition at line 55 of file MetricsController.cc.
| bool MetroCollect::MetricsController::isMetricNull | ( | size_t | index | ) | const |
Checks wether a metric is zero.
| index | index of the metric to check |
Definition at line 229 of file MetricsController.cc.
|
noexcept |
Returns the length of the processing window used to compute statistics.
Definition at line 76 of file MetricsController.cc.
|
noexcept |
Returns the overlap of the processing window used to compute statistics.
Definition at line 80 of file MetricsController.cc.
|
noexcept |
Returns the list of request metrics.
Definition at line 68 of file MetricsController.cc.

|
protected |
Reset iterative stats to begin new processing window.
Definition at line 288 of file MetricsController.cc.


|
noexcept |
Returns the metrics sampling interval.
Definition at line 72 of file MetricsController.cc.
|
noexcept |
Returns whether the controller alerts the delegate after computing statistics.
Definition at line 64 of file MetricsController.cc.

|
noexcept |
Returns whether the controller alerts the delegate after collecting new values.
Definition at line 60 of file MetricsController.cc.

|
noexcept |
Sets whether to convert metric differences to units per second.
Definition at line 168 of file MetricsController.cc.

|
noexcept |
Sets the processing window parameters used to compute statistics.
| length | length of the processing window |
| overlap | overlap of the processing window |
Definition at line 153 of file MetricsController.cc.

|
noexcept |
Sets the list of request metrics.
Definition at line 97 of file MetricsController.cc.

|
noexcept |
Sets the metrics sampling interval.
Definition at line 142 of file MetricsController.cc.

|
noexcept |
Sets whether the controller alerts the delegate after computing statistics.
Definition at line 93 of file MetricsController.cc.

|
noexcept |
Sets whether the controller alerts the delegate after collecting new values.
Definition at line 89 of file MetricsController.cc.

|
protected |
Update iterative stats with new MetricsDiffArray.
Definition at line 241 of file MetricsController.cc.


|
protected |
Fetch latest metrics from source and compute their variations.
Definition at line 234 of file MetricsController.cc.

|
protected |
Whether to convert metric differences to units per second.
Definition at line 141 of file MetricsController.h.
|
protected |
Pointer to latest metric raw values.
Definition at line 146 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 53 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 51 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 52 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 49 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 45 of file MetricsController.h.
|
static |
Default parameter option.
Definition at line 44 of file MetricsController.h.
|
protected |
Delegate to alert when something happens.
Definition at line 132 of file MetricsController.h.
|
protected |
Whether the receiver is collecting metrics.
Definition at line 138 of file MetricsController.h.
|
protected |
Final statistics arrays.
Definition at line 151 of file MetricsController.h.
|
protected |
Intermediate statistics arrays.
Definition at line 150 of file MetricsController.h.
|
protected |
CircularArray holding all metric differences, used to compute statistics.
Definition at line 149 of file MetricsController.h.
|
protected |
Pointer to earlier metric raw values.
Definition at line 147 of file MetricsController.h.
|
protected |
Length of processing window used to compute statistics.
Definition at line 143 of file MetricsController.h.
|
protected |
Overlap of processing window used to compute statistics.
Definition at line 144 of file MetricsController.h.
|
protected |
Indexes of metrics requested to be collected.
Definition at line 134 of file MetricsController.h.
|
protected |
Metrics sampling interval.
Definition at line 139 of file MetricsController.h.
|
protected |
Whether to compute stats and give them to the delegate.
Definition at line 136 of file MetricsController.h.
|
protected |
Whether to give values to the delegate.
Definition at line 135 of file MetricsController.h.
|
protected |
Boolean arrays to store source interests.
Definition at line 133 of file MetricsController.h.
|
protected |
Factor to convert metric differences to units per second.
Definition at line 140 of file MetricsController.h.