MetricMathBase Class
Base class for metric math engines. More...
| Header: | #include <MetricMathBase> |
| Inherits: | IMetricMath |
| Inherited By: |
Public Functions
| virtual | ~MetricMathBase() |
Reimplemented Public Functions
| virtual void | Consume(const std::vector<MetricEvent> &events) override |
| virtual void | FinishWindow() override |
| virtual void | InitDone() override |
| virtual void | Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks) override |
| virtual void | StartWindow(uint64_t fromTs, uint64_t toTs) override |
- 5 public functions inherited from IMetricMath
Protected Types
| class | BoundedCounter |
| class | ControlProcessResult |
| class | SampledPropertyPair |
Protected Functions
| const char * | ChannelKindLabel(uint8_t channel) const |
| bool | CoerceToTruth(const CDP::StudioAPI::CDPVariantValue &value, bool previousState, double threshold = 0.5, double hysteresis = 1e-9) const |
| bool | IsEnabled() const |
| bool | IsMeasureChannel(uint8_t id) const |
| CDPProperty<T> * | MakeSampledProperty(CDPProperty<T> *source, const std::string &sampledName, CDP::System::Base::PropertyCreateFlags flags = {}) |
| CDPProperty<T> * | MakeTypedProperty(const std::string &name, CDP::System::Base::PropertyCreateFlags flags) |
| ControlProcessResult | ProcessControlEvent(const MetricEvent &event, double threshold = 0.5, double hysteresis = 1e-9) |
| void | RecordHistogramSample(uint8_t channel, const CDP::StudioAPI::CDPVariantValue &value) |
| void | RegisterSampledPair(CDPPropertyBase *source, CDPPropertyBase *sampled) |
| void | SnapshotSampledProperties() |
Detailed Description
Base class for metric math engines.
This class provides a default implementation for `IMetricMath` and includes helper methods for handling channels, control states, and property creation. It simplifies the implementation of custom metric math engines.
Member Function Documentation
[virtual] MetricMathBase::~MetricMathBase()
Destroys the instance of MetricMathBase. The destructor is virtual.
[protected] const char *MetricMathBase::ChannelKindLabel(uint8_t channel) const
[protected] bool MetricMathBase::CoerceToTruth(const CDP::StudioAPI::CDPVariantValue &value, bool previousState, double threshold = 0.5, double hysteresis = 1e-9) const
[override virtual] void MetricMathBase::Consume(const std::vector<MetricEvent> &events)
Reimplemented from IMetricMath::Consume().
[override virtual] void MetricMathBase::FinishWindow()
Reimplemented from IMetricMath::FinishWindow().
[override virtual] void MetricMathBase::InitDone()
[override virtual] void MetricMathBase::Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks)
Reimplemented from IMetricMath::Initialize().
[protected] bool MetricMathBase::IsEnabled() const
[protected] bool MetricMathBase::IsMeasureChannel(uint8_t id) const
[protected] CDPProperty<T> *MetricMathBase::MakeSampledProperty(CDPProperty<T> *source, const std::string &sampledName, CDP::System::Base::PropertyCreateFlags flags = {})
[protected] CDPProperty<T> *MetricMathBase::MakeTypedProperty(const std::string &name, CDP::System::Base::PropertyCreateFlags flags)
[protected] ControlProcessResult MetricMathBase::ProcessControlEvent(const MetricEvent &event, double threshold = 0.5, double hysteresis = 1e-9)
[protected] void MetricMathBase::RecordHistogramSample(uint8_t channel, const CDP::StudioAPI::CDPVariantValue &value)
[protected] void MetricMathBase::RegisterSampledPair(CDPPropertyBase *source, CDPPropertyBase *sampled)
[protected] void MetricMathBase::SnapshotSampledProperties()
[override virtual] void MetricMathBase::StartWindow(uint64_t fromTs, uint64_t toTs)
Reimplemented from IMetricMath::StartWindow().
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.