Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
monitoring.h File Reference

C++20 concepts for monitoring and metric collection interfaces. More...

#include <chrono>
#include <concepts>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_map>
Include dependency graph for monitoring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::interfaces
 
namespace  kcenon::common::concepts
 C++20 concepts for compile-time type validation.
 

Concepts

concept  kcenon::common::concepts::CounterMetric
 A type that supports counter metric operations.
 
concept  kcenon::common::concepts::GaugeMetric
 A type that supports gauge metric operations.
 
concept  kcenon::common::concepts::HistogramMetric
 A type that supports histogram metric operations.
 
concept  kcenon::common::concepts::TimingMetric
 A type that supports timing metric operations.
 
concept  kcenon::common::concepts::MetricCollectorLike
 A complete metric collector type satisfying IMetricCollector interface.
 
concept  kcenon::common::concepts::NamedImplementation
 A type that provides implementation name for debugging.
 
concept  kcenon::common::concepts::MetricCollectorProviderLike
 A type that can provide metric collector instances.
 

Typedefs

using kcenon::common::interfaces::metric_labels = std::unordered_map<std::string, std::string>
 Metric labels for dimensional data.
 

Detailed Description

C++20 concepts for monitoring and metric collection interfaces.

This header provides concepts for validating metric collector types used in observability operations. These concepts replace abstract class-based constraints with compile-time validation and clearer error messages.

Requirements:

  • C++20 compiler with concepts support
  • GCC 10+, Clang 10+, MSVC 2022+

Thread Safety:

  • Concepts are evaluated at compile-time only.
  • No runtime thread-safety considerations apply.
See also
metric_collector_interface.h for IMetricCollector definition
https://en.cppreference.com/w/cpp/language/constraints

Definition in file monitoring.h.