IMetricMath Class
Interface for implementing custom metric math engines. More...
| Header: | #include <IMetricMath> |
| Inherited By: |
Public Functions
| virtual | ~IMetricMath() = default |
| virtual void | Consume(const std::vector<MetricEvent> &events) = 0 |
| virtual void | FinishWindow() = 0 |
| virtual void | InitDone() = 0 |
| virtual void | Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks) = 0 |
| virtual void | StartWindow(uint64_t fromTs, uint64_t toTs) = 0 |
Detailed Description
Interface for implementing custom metric math engines.
This interface defines the lifecycle and data consumption methods that a metric math engine must implement. It is used by MetricNode to drive the calculation of metrics based on incoming events.
Member Function Documentation
[default] IMetricMath::~IMetricMath()
Destroys the instance of IMetricMath. The destructor is virtual.
[pure virtual] void IMetricMath::Consume(const std::vector<MetricEvent> &events)
Consumes a batch of events. events The list of events to process, sorted by timestamp.
[pure virtual] void IMetricMath::FinishWindow()
Finishes the current calculation window. Finalize any time-based accumulation to window end and commit to properties as needed.
[pure virtual] void IMetricMath::InitDone()
Called after Initialize when the orchestrator considers the math engine ready to start processing. This is intended for initialization that depends on persisted/external values being loaded into created properties.
[pure virtual] void IMetricMath::Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks)
Initializes the math engine. measureType The type of measurement. channels The list of channels to process. opts Configuration options for the metric. factory Factory for creating dynamic properties. callbacks Callback hooks for the orchestrator.
Called once after construction. Implementer should inspect channels, read options, and create dynamic properties via factory.
[pure virtual] void IMetricMath::StartWindow(uint64_t fromTs, uint64_t toTs)
Starts a new calculation window. fromTs The start timestamp of the window (inclusive). toTs The end timestamp of the window (inclusive).
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.