37 class ControllerDelegate;
46 static constexpr std::chrono::seconds defaultSamplingInterval = 0s;
48 static constexpr std::chrono::seconds defaultSamplingInterval = 10s;
68 void updateSources() noexcept;
73 void computeMatches() noexcept;
82 void parseData(const
Source& source, const
std::cmatch& match, const
Matcher& matcher) noexcept;
102 bool isCollecting() const noexcept;
107 std::chrono::seconds samplingInterval() const noexcept;
115 void loadConfigFromFile(const
std::
string& configPath);
120 void setSamplingInterval(
std::chrono::seconds interval) noexcept;
128 std::vector<const
Metric*> availableMetrics() noexcept;
133 void collectMetrics() noexcept;
150 virtual void contollerCollectedMetrics(
const Controller& controller,
const std::vector<const Metric*>& metrics) = 0;
159 virtual bool contollerShouldStopCollectingMetrics(
const Controller& controller) = 0;
std::map< size_t, Metric > metrics_
Map associating keys to their metric.
std::vector< std::shared_ptr< Matcher > > matchers_
Array of matchers.
ControllerDelegate & delegate_
Delegate to alert when something happens.
Class used to represent a source (file or command output) from which metrics can be matched...
Class used to represent a matcher, that is a way to convert expressions matches into a metric...
bool isCollecting_
Whether the receiver is collecting metrics.
size_t roundKey_
Metric collection iteration unique identifier.
std::vector< std::shared_ptr< Source > > sources_
Array of sources.
std::vector< const Metric * > updatedMetrics_
Array of pointers to the iteration's metrics.
std::vector< std::shared_ptr< Expression > > expressions_
Array of expressions.
Class used to represent a metric object (with a name, unit, tags, a value and a timestamp) ...
Abstract delegate of Controller.
std::chrono::seconds samplingInterval_
Metrics sampling interval.
double unitsPerSecondFactor_
Factor to convert metric differences to units per second.