|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Abstract interface for metrics export backends. More...
#include <metrics_backend.h>


Public Member Functions | |
| virtual | ~MetricsBackend ()=default |
| Virtual destructor for proper cleanup. | |
| virtual std::string | name () const =0 |
| Get the backend name. | |
| virtual std::string | export_base (const BaseSnapshot &snapshot) const =0 |
| Export base metrics snapshot. | |
| virtual std::string | export_enhanced (const EnhancedSnapshot &snapshot) const =0 |
| Export enhanced metrics snapshot. | |
| virtual void | set_prefix (const std::string &prefix) |
| Set metric name prefix. | |
| const std::string & | prefix () const |
| Get current metric name prefix. | |
| virtual void | add_label (const std::string &key, const std::string &value) |
| Add a label to all exported metrics. | |
| const std::map< std::string, std::string > & | labels () const |
| Get all configured labels. | |
Protected Member Functions | |
| MetricsBackend ()=default | |
| Default constructor. | |
Protected Attributes | |
| std::string | prefix_ {"thread_pool"} |
| Metric name prefix. | |
| std::map< std::string, std::string > | labels_ |
| Labels to attach to all metrics. | |
Abstract interface for metrics export backends.
This interface defines the contract for exporting metrics to various monitoring systems (Prometheus, JSON, logging, etc.).
Definition at line 57 of file metrics_backend.h.
|
virtualdefault |
Virtual destructor for proper cleanup.
|
protecteddefault |
Default constructor.
|
inlinevirtual |
Add a label to all exported metrics.
| key | Label key. |
| value | Label value. |
Definition at line 107 of file metrics_backend.h.
References labels_.
|
nodiscardpure virtual |
Export base metrics snapshot.
| snapshot | The base metrics snapshot to export. |
Implemented in kcenon::thread::metrics::JsonBackend, kcenon::thread::metrics::LoggingBackend, and kcenon::thread::metrics::PrometheusBackend.
|
nodiscardpure virtual |
Export enhanced metrics snapshot.
| snapshot | The enhanced metrics snapshot to export. |
Implemented in kcenon::thread::metrics::JsonBackend, kcenon::thread::metrics::LoggingBackend, and kcenon::thread::metrics::PrometheusBackend.
|
inlinenodiscard |
Get all configured labels.
Definition at line 115 of file metrics_backend.h.
References labels_.
Referenced by kcenon::thread::metrics::PrometheusBackend::export_base(), and kcenon::thread::metrics::PrometheusBackend::export_enhanced().

|
nodiscardpure virtual |
Get the backend name.
Implemented in kcenon::thread::metrics::JsonBackend, kcenon::thread::metrics::LoggingBackend, and kcenon::thread::metrics::PrometheusBackend.
|
inlinenodiscard |
Get current metric name prefix.
Definition at line 98 of file metrics_backend.h.
References prefix_.
Referenced by set_prefix().

|
inlinevirtual |
Set metric name prefix.
| prefix | Prefix to prepend to all metric names. |
Definition at line 90 of file metrics_backend.h.
References prefix(), and prefix_.
Referenced by kcenon::thread::metrics::EnhancedThreadPoolMetrics::to_prometheus().


|
protected |
Labels to attach to all metrics.
Definition at line 133 of file metrics_backend.h.
Referenced by add_label(), kcenon::thread::metrics::PrometheusBackend::export_enhanced(), kcenon::thread::metrics::PrometheusBackend::format_labels(), and labels().
|
protected |
Metric name prefix.
Definition at line 128 of file metrics_backend.h.
Referenced by kcenon::thread::metrics::LoggingBackend::export_base(), kcenon::thread::metrics::PrometheusBackend::export_base(), kcenon::thread::metrics::LoggingBackend::export_enhanced(), kcenon::thread::metrics::PrometheusBackend::export_enhanced(), prefix(), and set_prefix().