• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • CDP Linux
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • MetricCallbacks
  • 5.1.0

MetricCallbacks Class

Optional logging callbacks provided to metric math engines. More...

Header: #include <MetricCallbacks>
  • List of all members, including inherited members

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.

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2026 CDP Technologies. Privacy and cookie policy.

Return to top