|
PACS System 0.1.0
PACS DICOM system library
|
Adapter for PACS performance metrics and distributed tracing. More...
#include <monitoring_adapter.h>

Classes | |
| struct | health_status |
| Health check result containing component status. More... | |
| class | impl |
| class | span |
| Represents a unit of work in distributed tracing. More... | |
Static Public Member Functions | |
| static void | initialize (const monitoring_config &config) |
| Initialize the monitoring adapter with configuration. | |
| static void | shutdown () |
| Shutdown the monitoring adapter. | |
| static auto | is_initialized () noexcept -> bool |
| Check if the monitoring adapter is initialized. | |
| static void | increment_counter (std::string_view name, std::int64_t value=1) |
| Increment a counter metric. | |
| static void | set_gauge (std::string_view name, double value) |
| Set a gauge metric value. | |
| static void | record_histogram (std::string_view name, double value) |
| Record a histogram sample. | |
| static void | record_timing (std::string_view name, std::chrono::nanoseconds duration) |
| Record a timing measurement. | |
| static void | record_c_store (std::chrono::nanoseconds duration, std::size_t bytes, bool success) |
| Record C-STORE operation metrics. | |
| static void | record_c_find (std::chrono::nanoseconds duration, std::size_t matches, query_level level) |
| Record C-FIND operation metrics. | |
| static void | record_association (const std::string &calling_ae, bool established) |
| Record DICOM association metrics. | |
| static void | update_storage_stats (std::size_t total_instances, std::size_t total_bytes) |
| Update storage statistics. | |
| static auto | start_span (std::string_view operation) -> span |
| Start a new trace span. | |
| static auto | get_health () -> health_status |
| Get current health status. | |
| static void | register_health_check (std::string_view component, std::function< bool()> check) |
| Register a health check for a component. | |
| static void | unregister_health_check (std::string_view component) |
| Unregister a health check. | |
| static auto | get_config () -> const monitoring_config & |
| Get the current configuration. | |
Static Private Member Functions | |
| static auto | query_level_to_string (query_level level) -> std::string |
Static Private Attributes | |
| static std::unique_ptr< impl > | pimpl_ |
Adapter for PACS performance metrics and distributed tracing.
This class provides a unified interface for monitoring in the PACS system, including:
The adapter uses monitoring_system's high-performance profiling internally while providing a PACS-specific API.
Thread Safety: All methods are thread-safe.
Definition at line 128 of file monitoring_adapter.h.
|
staticnodiscard |
Get the current configuration.
Definition at line 489 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::monitoring_adapter::impl::get_config(), and pimpl_.

|
staticnodiscard |
Get current health status.
Definition at line 472 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::monitoring_adapter::impl::get_health(), and pimpl_.

|
static |
Increment a counter metric.
| name | The counter name |
| value | The value to add (default: 1) |
Definition at line 416 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::monitoring_adapter::impl::increment_counter(), name, and pimpl_.
Referenced by kcenon::pacs::workflow::auto_prefetch_service::execute_cycle(), kcenon::pacs::workflow::task_scheduler::execute_cycle(), kcenon::pacs::workflow::task_scheduler::execute_task(), ai_service_connector::impl::request_inference(), and job_tracker::update_status().


|
static |
Initialize the monitoring adapter with configuration.
Must be called before any monitoring operations. Sets up metrics collection, tracing, and health check endpoints if configured.
| config | Configuration options |
Definition at line 402 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::monitoring_adapter::impl::initialize(), and pimpl_.

|
staticnodiscardnoexcept |
Check if the monitoring adapter is initialized.
Definition at line 408 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::monitoring_adapter::impl::is_initialized(), and pimpl_.

|
staticnodiscardprivate |
Definition at line 497 of file monitoring_adapter.cpp.
References kcenon::pacs::integration::image, kcenon::pacs::integration::patient, kcenon::pacs::integration::series, and kcenon::pacs::integration::study.
|
static |
Record DICOM association metrics.
Records metrics for DICOM association establishment/release.
Metrics recorded:
| calling_ae | AE title of the remote system |
| established | true if association was established, false if released |
Definition at line 450 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::record_association().

|
static |
Record C-FIND operation metrics.
Records performance metrics for a DICOM C-FIND query operation.
Metrics recorded:
| duration | Time taken for the query |
| matches | Number of matching records returned |
| level | Query retrieve level (patient, study, series, image) |
Definition at line 444 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::record_c_find().

|
static |
Record C-STORE operation metrics.
Records performance metrics for a DICOM C-STORE operation including duration, bytes transferred, and success/failure status.
Metrics recorded:
| duration | Time taken for the operation |
| bytes | Number of bytes transferred |
| success | Whether the operation succeeded |
Definition at line 438 of file monitoring_adapter.cpp.
References pimpl_, kcenon::pacs::integration::monitoring_adapter::impl::record_c_store(), and kcenon::pacs::integration::success.

|
static |
Record a histogram sample.
| name | The histogram name |
| value | The sample value |
Definition at line 425 of file monitoring_adapter.cpp.
References name, pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::record_histogram().
Referenced by kcenon::pacs::workflow::auto_prefetch_service::execute_cycle(), and kcenon::pacs::workflow::task_scheduler::execute_task().


|
static |
Record a timing measurement.
| name | The timing metric name |
| duration | The duration to record |
Definition at line 429 of file monitoring_adapter.cpp.
References name, pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::record_timing().
Referenced by job_tracker::update_status().


|
static |
Register a health check for a component.
The provided function will be called during health checks. It should return true if the component is healthy.
| component | Name of the component |
| check | Function that returns true if healthy |
Definition at line 476 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::register_health_check().

|
static |
Set a gauge metric value.
| name | The gauge name |
| value | The current value |
Definition at line 421 of file monitoring_adapter.cpp.
References name, pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::set_gauge().
Referenced by job_tracker::add_job(), ai_service_connector::impl::initialize(), and job_tracker::remove_job().


|
static |
Shutdown the monitoring adapter.
Flushes all pending metrics and releases resources. Should be called before application exit.
Definition at line 406 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::shutdown().

|
staticnodiscard |
Start a new trace span.
| operation | Name of the operation |
Definition at line 464 of file monitoring_adapter.cpp.
|
static |
Unregister a health check.
| component | Name of the component to unregister |
Definition at line 481 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::unregister_health_check().

|
static |
Update storage statistics.
Updates gauge metrics for storage usage.
Metrics recorded:
| total_instances | Total number of stored DICOM instances |
| total_bytes | Total storage used in bytes |
Definition at line 455 of file monitoring_adapter.cpp.
References pimpl_, and kcenon::pacs::integration::monitoring_adapter::impl::update_storage_stats().

|
staticprivate |
Definition at line 404 of file monitoring_adapter.h.
Referenced by get_config(), get_health(), increment_counter(), initialize(), is_initialized(), record_association(), record_c_find(), record_c_store(), record_histogram(), record_timing(), register_health_check(), set_gauge(), shutdown(), unregister_health_check(), and update_storage_stats().