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

Statistics for PDU buffer pool usage monitoring. More...

#include <pdu_buffer_pool.h>

Collaboration diagram for kcenon::pacs::network::pdu_pool_statistics:
Collaboration graph

Public Member Functions

auto hit_ratio () const noexcept -> double
 Calculate hit ratio (0.0 to 1.0)
 
void reset () noexcept
 Reset all statistics.
 

Public Attributes

std::atomic< uint64_t > total_acquisitions {0}
 
std::atomic< uint64_t > pool_hits {0}
 
std::atomic< uint64_t > pool_misses {0}
 
std::atomic< uint64_t > total_releases {0}
 
std::atomic< uint64_t > total_bytes_allocated {0}
 

Detailed Description

Statistics for PDU buffer pool usage monitoring.

Definition at line 36 of file pdu_buffer_pool.h.

Member Function Documentation

◆ hit_ratio()

auto kcenon::pacs::network::pdu_pool_statistics::hit_ratio ( ) const -> double
inlinenodiscardnoexcept

Calculate hit ratio (0.0 to 1.0)

Returns
Hit ratio, or 0.0 if no acquisitions
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pdu_buffer_pool.h.

Definition at line 47 of file pdu_buffer_pool.h.

47 {
48 const uint64_t total = total_acquisitions.load(std::memory_order_relaxed);
49 if (total == 0) {
50 return 0.0;
51 }
52 return static_cast<double>(pool_hits.load(std::memory_order_relaxed))
53 / static_cast<double>(total);
54 }

References pool_hits, and total_acquisitions.

◆ reset()

void kcenon::pacs::network::pdu_pool_statistics::reset ( )
inlinenoexcept

Reset all statistics.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pdu_buffer_pool.h.

Definition at line 59 of file pdu_buffer_pool.h.

59 {
60 total_acquisitions.store(0, std::memory_order_relaxed);
61 pool_hits.store(0, std::memory_order_relaxed);
62 pool_misses.store(0, std::memory_order_relaxed);
63 total_releases.store(0, std::memory_order_relaxed);
64 total_bytes_allocated.store(0, std::memory_order_relaxed);
65 }

References pool_hits, pool_misses, total_acquisitions, total_bytes_allocated, and total_releases.

Referenced by kcenon::pacs::network::pdu_buffer_pool::reset_statistics().

Here is the caller graph for this function:

Member Data Documentation

◆ pool_hits

std::atomic<uint64_t> kcenon::pacs::network::pdu_pool_statistics::pool_hits {0}

◆ pool_misses

std::atomic<uint64_t> kcenon::pacs::network::pdu_pool_statistics::pool_misses {0}

◆ total_acquisitions

std::atomic<uint64_t> kcenon::pacs::network::pdu_pool_statistics::total_acquisitions {0}

◆ total_bytes_allocated

std::atomic<uint64_t> kcenon::pacs::network::pdu_pool_statistics::total_bytes_allocated {0}

◆ total_releases

std::atomic<uint64_t> kcenon::pacs::network::pdu_pool_statistics::total_releases {0}

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