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

Statistics for object pool usage monitoring. More...

#include <pool_manager.h>

Collaboration diagram for kcenon::pacs::core::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}
 

Detailed Description

Statistics for object pool usage monitoring.

Definition at line 37 of file pool_manager.h.

Member Function Documentation

◆ hit_ratio()

auto kcenon::pacs::core::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/core/pool_manager.h.

Definition at line 47 of file pool_manager.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 }
std::atomic< uint64_t > total_acquisitions
std::atomic< uint64_t > pool_hits

References pool_hits, and total_acquisitions.

◆ reset()

void kcenon::pacs::core::pool_statistics::reset ( )
inlinenoexcept

Reset all statistics.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/core/pool_manager.h.

Definition at line 59 of file pool_manager.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 }
std::atomic< uint64_t > total_releases
std::atomic< uint64_t > pool_misses

References pool_hits, pool_misses, total_acquisitions, and total_releases.

Referenced by kcenon::pacs::core::pool_manager::reset_statistics().

Here is the caller graph for this function:

Member Data Documentation

◆ pool_hits

std::atomic<uint64_t> kcenon::pacs::core::pool_statistics::pool_hits {0}

◆ pool_misses

std::atomic<uint64_t> kcenon::pacs::core::pool_statistics::pool_misses {0}

◆ total_acquisitions

std::atomic<uint64_t> kcenon::pacs::core::pool_statistics::total_acquisitions {0}

◆ total_releases

std::atomic<uint64_t> kcenon::pacs::core::pool_statistics::total_releases {0}

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