|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Classes | |
| class | composite_health_check |
| Aggregates multiple health checks into a single check. More... | |
| class | GlobalLoggerRegistry |
| Thread-safe singleton registry for managing logger instances. More... | |
| interface | health_check |
| Abstract base class for health checks. More... | |
| class | health_check_builder |
| Fluent builder for creating health checks. More... | |
| struct | health_check_result |
| Result of a health check operation. More... | |
| class | health_dependency_graph |
| Manages dependencies between health checks as a DAG. More... | |
| class | health_monitor |
| Central health monitoring system. More... | |
| struct | health_monitor_stats |
| Statistics for health monitoring. More... | |
| struct | http_request |
| Represents an HTTP request. More... | |
| struct | http_response |
| Represents an HTTP response. More... | |
| class | IDatabase |
| Standard interface for database operations. More... | |
| interface | IExecutor |
| Abstract interface for task execution systems. More... | |
| interface | IExecutorProvider |
| Interface for modules that provide executor implementations. More... | |
| interface | IHttpClient |
| Abstract interface for HTTP client implementations. More... | |
| interface | IHttpClientProvider |
| Interface for modules that provide HTTP client implementations. More... | |
| interface | IJob |
| Abstract job interface for task execution. More... | |
| interface | ILogger |
| Standard interface for logging implementations. More... | |
| interface | ILoggerProvider |
| Interface for modules that provide logger implementations. More... | |
| interface | ILoggerRegistry |
| Phase 2: Global logger registry interface. More... | |
| interface | IMetricCollector |
| Abstract interface for collecting metrics across modules. More... | |
| interface | IMetricCollectorProvider |
| Interface for modules that provide metric collector implementations. More... | |
| interface | IMonitor |
| Standard interface for monitoring implementations. More... | |
| interface | IMonitorable |
| Interface for objects that can be monitored. More... | |
| interface | IMonitorProvider |
| Interface for modules that provide monitor implementations. More... | |
| interface | IStats |
| Interface for components that expose statistics. More... | |
| interface | IThreadPool |
| Extended interface for thread pool implementations. More... | |
| interface | IThreadPoolProvider |
| Interface for modules that provide thread pool implementations. More... | |
| interface | IUdpClient |
| Abstract interface for UDP client implementations. More... | |
| interface | IUdpClientProvider |
| Interface for modules that provide UDP client implementations. More... | |
| class | lambda_health_check |
| Health check implementation using a lambda function. More... | |
| struct | log_entry |
| Standard log entry structure. More... | |
| struct | logger_config |
| Configuration for logger instances. More... | |
| struct | metric_value |
| Standard metric value structure with type information. More... | |
| struct | metrics_snapshot |
| Complete snapshot of metrics at a point in time. More... | |
| class | null_http_client |
| Null implementation for when HTTP transport is disabled. More... | |
| class | null_metric_collector |
| No-op implementation for when metrics are disabled. More... | |
| class | null_udp_client |
| Null implementation for when UDP transport is disabled. More... | |
| class | NullLogger |
| A no-op logger implementation for fallback scenarios. More... | |
| struct | registry_event |
| Represents a single audit event for registry mutations. More... | |
| class | RegistryAuditLog |
| Thread-safe audit log for registry operations. More... | |
| class | scoped_timer |
| RAII helper for automatic timing measurements. More... | |
| struct | stats_snapshot |
| Point-in-time snapshot of component statistics. More... | |
| struct | system_metrics |
| Specialized metrics for system-level monitoring. More... | |
| struct | thread_pool_metrics |
| Specialized metrics for thread pool monitoring. More... | |
| struct | udp_endpoint |
| Represents a UDP endpoint (host and port) More... | |
| struct | udp_send_options |
| Options for UDP send operations. More... | |
| struct | udp_statistics |
| Statistics for UDP client operations. More... | |
| struct | worker_metrics |
| Specialized metrics for worker thread monitoring. More... | |
Typedefs | |
| using | metric_labels = std::unordered_map<std::string, std::string> |
| Metric labels for dimensional data. | |
| using | kcenon::common::interfaces::ExecutorFactory = std::function<std::shared_ptr<IExecutor>()> |
| Factory function type for creating executor instances. | |
| using | kcenon::common::interfaces::LoggerFactory = std::function<std::shared_ptr<ILogger>()> |
| Factory function type for creating logger instances. | |
| using | recovery_handler = std::function<bool()> |
| Recovery handler function type. | |
| using | MetricCollectorFactory = std::function<std::shared_ptr<IMetricCollector>()> |
| Factory function type for creating metric collector instances. | |
| using | MonitorFactory = std::function<std::shared_ptr<IMonitor>()> |
| Factory function type for creating monitor instances. | |
| using | source_location = kcenon::common::source_location |
| using | stats_value |
| Type-safe value type for statistics. | |
| using | kcenon::common::interfaces::ThreadPoolFactory = std::function<std::shared_ptr<IThreadPool>(size_t worker_count)> |
| Factory function type for creating thread pool instances. | |
| using | http_headers = std::map<std::string, std::string> |
| HTTP headers container type. | |
| using | HttpClientFactory = std::function<std::shared_ptr<IHttpClient>()> |
| Factory function type for creating HTTP client instances. | |
| using | UdpClientFactory = std::function<std::shared_ptr<IUdpClient>()> |
| Factory function type for creating UDP client instances. | |
Functions | |
| GlobalLoggerRegistry & | get_registry () |
| Get the global logger registry instance. | |
| std::shared_ptr< ILogger > | get_logger () |
| Get the default logger from the global registry. | |
| std::shared_ptr< ILogger > | get_logger (const std::string &name) |
| Get a named logger from the global registry. | |
| std::string | kcenon::common::interfaces::to_string (log_level level) |
| Convert log level to string. | |
| log_level | kcenon::common::interfaces::from_string (const std::string &str) |
| Parse log level from string (case-insensitive) | |
| std::string | to_string (health_check_type type) |
| Convert health check type to string. | |
| Result< health_check_type > | health_check_type_from_string (const std::string &str) |
| Convert string to health check type. | |
| health_monitor & | global_health_monitor () |
| Get the global health monitor instance. | |
| std::string | to_string (metric_type type) |
| Convert metric type to string. | |
| Result< metric_type > | metric_type_from_string (const std::string &str) |
| Convert string to metric type. | |
| std::string | to_string (health_status status) |
| Convert health status to string. | |
| const char * | to_string (registry_action action) |
| Convert registry_action to string representation. | |
|
export |
Factory function type for creating executor instances.
Definition at line 130 of file executor_interface.h.
| using kcenon::common::interfaces::http_headers = std::map<std::string, std::string> |
HTTP headers container type.
Definition at line 31 of file http_client_interface.h.
| using kcenon::common::interfaces::HttpClientFactory = std::function<std::shared_ptr<IHttpClient>()> |
Factory function type for creating HTTP client instances.
Definition at line 265 of file http_client_interface.h.
|
export |
Factory function type for creating logger instances.
Definition at line 232 of file logger_interface.h.
| typedef std::unordered_map< std::string, std::string > kcenon::common::interfaces::metric_labels = std::unordered_map<std::string, std::string> |
Metric labels for dimensional data.
Labels allow attaching key-value pairs to metrics for filtering and grouping in monitoring systems (e.g., Prometheus, StatsD).
Example:
Definition at line 38 of file monitoring.h.
| using kcenon::common::interfaces::MetricCollectorFactory = std::function<std::shared_ptr<IMetricCollector>()> |
Factory function type for creating metric collector instances.
Definition at line 249 of file metric_collector_interface.h.
| using kcenon::common::interfaces::MonitorFactory = std::function<std::shared_ptr<IMonitor>()> |
Factory function type for creating monitor instances.
Definition at line 339 of file monitoring_interface.h.
| using kcenon::common::interfaces::recovery_handler = std::function<bool()> |
Recovery handler function type.
A recovery handler is called when a health check fails. It should attempt to recover the failed component.
Definition at line 56 of file health_monitor.h.
Definition at line 36 of file registry_audit_log.h.
| typedef std::variant< std::int64_t, double, std::string, bool > kcenon::common::interfaces::stats_value |
Type-safe value type for statistics.
Supports common metric types: counters, gauges, rates, and boolean flags. Integer counters (request counts, error counts) Floating-point gauges (rates, percentages, latencies) String values (state names, labels) Boolean flags (enabled/disabled, healthy/unhealthy)
Definition at line 30 of file stats_interface.h.
|
export |
Factory function type for creating thread pool instances.
Definition at line 163 of file thread_pool_interface.h.
| using kcenon::common::interfaces::UdpClientFactory = std::function<std::shared_ptr<IUdpClient>()> |
Factory function type for creating UDP client instances.
Definition at line 311 of file udp_client_interface.h.
|
strong |
Types of health checks supported by the system.
| Enumerator | |
|---|---|
| liveness | |
| readiness | |
| startup | |
| dependency | |
| custom | |
Definition at line 31 of file health_check.h.
|
strong |
|
exportstrong |
Standard log levels.
| Enumerator | |
|---|---|
| trace | |
| debug | |
| info | |
| warning | |
| warn | Alias for warning (backward compatibility) |
| error | |
| critical | |
| fatal | Alias for critical (backward compatibility) |
| off | |
| trace | |
| debug | |
| info | |
| warning | |
| error | |
| critical | |
| off | |
Definition at line 41 of file logger_interface.h.
|
exportstrong |
| Enumerator | |
|---|---|
| trace | |
| debug | |
| info | |
| warning | |
| warn | Alias for warning (backward compatibility) |
| error | |
| critical | |
| fatal | Alias for critical (backward compatibility) |
| off | |
| trace | |
| debug | |
| info | |
| warning | |
| error | |
| critical | |
| off | |
Definition at line 51 of file logger.cppm.
|
strong |
Types of metrics supported by the monitoring system.
| Enumerator | |
|---|---|
| gauge | |
| counter | |
| histogram | |
| summary | |
Definition at line 36 of file monitoring_interface.h.
|
strong |
Types of registry mutation actions.
Definition at line 42 of file registry_audit_log.h.
|
inlineexport |
Parse log level from string (case-insensitive)
Supports aliases: WARN -> warning, FATAL -> critical
Definition at line 334 of file logger_interface.h.
References critical, kcenon::common::enum_from_string(), info, and warning.

|
inline |
Get the default logger from the global registry.
Convenience function to get the default logger. Returns NullLogger if no default logger is registered.
Definition at line 752 of file global_logger_registry.h.
References kcenon::common::interfaces::GlobalLoggerRegistry::get_default_logger(), and kcenon::common::interfaces::GlobalLoggerRegistry::instance().
Referenced by kcenon::common::logging::flush(), kcenon::common::logging::flush(), kcenon::common::logging::is_enabled(), kcenon::common::logging::is_enabled(), kcenon::common::logging::log(), and kcenon::common::logging::log().


|
inline |
Get a named logger from the global registry.
Convenience function to get a named logger. Returns NullLogger if the specified logger is not registered.
| name | Logger name |
Definition at line 765 of file global_logger_registry.h.
References kcenon::common::interfaces::GlobalLoggerRegistry::get_logger(), and kcenon::common::interfaces::GlobalLoggerRegistry::instance().

|
inline |
Get the global logger registry instance.
Convenience function to access the GlobalLoggerRegistry singleton.
Definition at line 740 of file global_logger_registry.h.
References kcenon::common::interfaces::GlobalLoggerRegistry::instance().

|
inline |
Get the global health monitor instance.
This function provides access to a global health monitor instance for application-wide health monitoring.
Example usage:
Definition at line 403 of file health_monitor.h.
|
inline |
Convert string to health check type.
Definition at line 72 of file health_check.h.
References kcenon::common::enum_from_string().
Referenced by main().


|
inline |
Convert string to metric type.
Definition at line 71 of file monitoring_interface.h.
References kcenon::common::enum_from_string().

|
inline |
Convert health check type to string.
Definition at line 65 of file health_check.h.
References kcenon::common::enum_to_string().

|
inline |
Convert health status to string.
Definition at line 366 of file monitoring_interface.h.
References kcenon::common::enum_to_string().

|
inlineexport |
Convert log level to string.
Definition at line 325 of file logger_interface.h.
References kcenon::common::enum_to_string().
Referenced by kcenon::common::interfaces::health_monitor::get_health_report(), kcenon::common::interfaces::health_monitor::get_overall_status_string(), kcenon::common::logging::ConsoleLogger::log(), kcenon::common::logging::ConsoleLogger::log(), and main().


|
inline |
Convert metric type to string.
Definition at line 64 of file monitoring_interface.h.
References kcenon::common::enum_to_string().

|
inline |
Convert registry_action to string representation.
| action | The action to convert |
Definition at line 61 of file registry_audit_log.h.
References clear_loggers, clear_services, freeze_logger_registry, freeze_service_container, register_factory, register_logger, register_service, set_default_factory, set_default_logger, unregister_logger, and unregister_service.