PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::monitoring::association_counters Struct Reference

Metrics for tracking DICOM association lifecycle. More...

#include <pacs_metrics.h>

Collaboration diagram for kcenon::pacs::monitoring::association_counters:
Collaboration graph

Public Member Functions

void record_established () noexcept
 Record an association being established.
 
void record_released () noexcept
 Record an association being released normally.
 
void record_rejected () noexcept
 Record an association being rejected.
 
void record_aborted () noexcept
 Record an association being aborted.
 
void reset () noexcept
 Reset all counters to zero.
 

Public Attributes

std::atomic< std::uint64_t > total_established {0}
 
std::atomic< std::uint64_t > total_rejected {0}
 
std::atomic< std::uint64_t > total_aborted {0}
 
std::atomic< std::uint32_t > current_active {0}
 
std::atomic< std::uint32_t > peak_active {0}
 

Detailed Description

Metrics for tracking DICOM association lifecycle.

Thread-safe counters for tracking association establishment, rejection, and current active count.

Definition at line 217 of file pacs_metrics.h.

Member Function Documentation

◆ record_aborted()

void kcenon::pacs::monitoring::association_counters::record_aborted ( )
inlinenoexcept

Record an association being aborted.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/pacs_metrics.h.

Definition at line 251 of file pacs_metrics.h.

251 {
252 total_aborted.fetch_add(1, std::memory_order_relaxed);
253 const auto prev = current_active.load(std::memory_order_relaxed);
254 if (prev > 0) {
255 current_active.fetch_sub(1, std::memory_order_relaxed);
256 }
257 }
std::atomic< std::uint64_t > total_aborted
std::atomic< std::uint32_t > current_active

References current_active, and total_aborted.

Referenced by kcenon::pacs::monitoring::pacs_metrics::record_association_aborted().

Here is the caller graph for this function:

◆ record_established()

void kcenon::pacs::monitoring::association_counters::record_established ( )
inlinenoexcept

Record an association being established.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/pacs_metrics.h.

Definition at line 225 of file pacs_metrics.h.

225 {
226 total_established.fetch_add(1, std::memory_order_relaxed);
227 const auto active = current_active.fetch_add(1, std::memory_order_relaxed) + 1;
228
229 // Update peak with CAS loop
230 auto current_peak = peak_active.load(std::memory_order_relaxed);
231 while (active > current_peak &&
232 !peak_active.compare_exchange_weak(current_peak, active,
233 std::memory_order_relaxed)) {
234 }
235 }
std::atomic< std::uint64_t > total_established

References current_active, peak_active, and total_established.

Referenced by kcenon::pacs::monitoring::pacs_metrics::record_association_established().

Here is the caller graph for this function:

◆ record_rejected()

void kcenon::pacs::monitoring::association_counters::record_rejected ( )
inlinenoexcept

Record an association being rejected.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/pacs_metrics.h.

Definition at line 246 of file pacs_metrics.h.

246 {
247 total_rejected.fetch_add(1, std::memory_order_relaxed);
248 }
std::atomic< std::uint64_t > total_rejected

References total_rejected.

Referenced by kcenon::pacs::monitoring::pacs_metrics::record_association_rejected().

Here is the caller graph for this function:

◆ record_released()

void kcenon::pacs::monitoring::association_counters::record_released ( )
inlinenoexcept

Record an association being released normally.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/pacs_metrics.h.

Definition at line 238 of file pacs_metrics.h.

238 {
239 const auto prev = current_active.load(std::memory_order_relaxed);
240 if (prev > 0) {
241 current_active.fetch_sub(1, std::memory_order_relaxed);
242 }
243 }

References current_active.

Referenced by kcenon::pacs::monitoring::pacs_metrics::record_association_released().

Here is the caller graph for this function:

◆ reset()

void kcenon::pacs::monitoring::association_counters::reset ( )
inlinenoexcept

Reset all counters to zero.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/pacs_metrics.h.

Definition at line 260 of file pacs_metrics.h.

260 {
261 total_established.store(0, std::memory_order_relaxed);
262 total_rejected.store(0, std::memory_order_relaxed);
263 total_aborted.store(0, std::memory_order_relaxed);
264 current_active.store(0, std::memory_order_relaxed);
265 peak_active.store(0, std::memory_order_relaxed);
266 }

References current_active, peak_active, total_aborted, total_established, and total_rejected.

Referenced by kcenon::pacs::monitoring::pacs_metrics::reset().

Here is the caller graph for this function:

Member Data Documentation

◆ current_active

◆ peak_active

std::atomic<std::uint32_t> kcenon::pacs::monitoring::association_counters::peak_active {0}

◆ total_aborted

std::atomic<std::uint64_t> kcenon::pacs::monitoring::association_counters::total_aborted {0}

◆ total_established

std::atomic<std::uint64_t> kcenon::pacs::monitoring::association_counters::total_established {0}

◆ total_rejected

std::atomic<std::uint64_t> kcenon::pacs::monitoring::association_counters::total_rejected {0}

The documentation for this struct was generated from the following file: