MetricCallbacks Class
Optional logging callbacks provided to metric math engines. More...
| Header: | #include <MetricCallbacks> |
Public Variables
| std::function<void( uint64_t ) > | flushNow |
| std::function<void( uint64_t, const std::vector<CDPPropertyBase *> & ) > | flushSelected |
Detailed Description
Optional logging callbacks provided to metric math engines.
Metric callbacks let a math engine request that updated metric values are written to the configured DataSink. These callbacks are mainly relevant when implementing custom metric math.
Use flushNow when the whole current metric state should be logged at a timestamp. Use flushSelected when only specific output properties should be written for that timestamp.
These callbacks are complementary, not alternatives in the abstract API. A custom math can use flushSelected for sparse sample-driven logging while still using flushNow for full-state events such as control-edge or reset-related logging.
Member Variable Documentation
std::function<void( uint64_t ) > MetricCallbacks::flushNow
This variable holds requests a normal metric flush at the given timestamp.
This callback writes the current metric values to the DataSink using the supplied timestamp. Use it when the sink should receive the full current metric state, such as on control edges, reset-related logging, or math types where all outputs belong together.
std::function<void( uint64_t, const std::vector<CDPPropertyBase *> & ) > MetricCallbacks::flushSelected
This variable holds requests a sparse metric flush for selected output properties only.
This callback writes only the provided output properties to the DataSink using the supplied timestamp. Use it when a custom math should log measures independently instead of writing the whole current metric state on every log event, for example in per-measure delta logging.
The property list must contain output properties created for the current metric through the provided property factory. Properties that are not included are left out of that sink write.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.