GridFire 0.6.0
General Purpose Nuclear Network
|
Struct for tracking cache statistics. More...
Public Types | |
enum class | operators { CalculateRHSAndEnergy , GenerateJacobianMatrix , CalculateMolarReactionFlow , GetSpeciesTimescales , GetSpeciesDestructionTimescales , Other , All } |
Public Member Functions | |
void | hit (const operators op=operators::Other) |
Increments the hit counter for a given operator. | |
void | miss (const operators op=operators::Other) |
Increments the miss counter for a given operator. | |
size_t | hits (const operators op=operators::All) const |
Gets the number of hits for a specific operator or all operators. | |
size_t | misses (const operators op=operators::All) const |
Gets the number of misses for a specific operator or all operators. | |
Public Attributes | |
std::map< operators,std::string > | operatorsNameMap |
Map from operators to their string names for logging. | |
size_t | m_hit = 0 |
Total number of cache hits. | |
size_t | m_miss = 0 |
Total number of cache misses. | |
std::map< operators,size_t > | m_operatorHits |
Map from operators to the number of cache hits for that operator. | |
std::map< operators,size_t > | m_operatorMisses |
Map from operators to the number of cache misses for that operator. | |
Struct for tracking cache statistics.
|
strong |
void gridfire::MultiscalePartitioningEngineView::CacheStats::hit | ( | const operators | op = operators::Other | ) |
Increments the hit counter for a given operator.
op | The operator that resulted in a cache hit. |
std::invalid_argument | if op is All . |
|
nodiscard |
Gets the number of hits for a specific operator or all operators.
op | The operator to get the number of hits for. Defaults to All . |
void gridfire::MultiscalePartitioningEngineView::CacheStats::miss | ( | const operators | op = operators::Other | ) |
Increments the miss counter for a given operator.
op | The operator that resulted in a cache miss. |
std::invalid_argument | if op is All . |
|
nodiscard |
Gets the number of misses for a specific operator or all operators.
op | The operator to get the number of misses for. Defaults to All . |
size_t gridfire::MultiscalePartitioningEngineView::CacheStats::m_hit = 0 |
Total number of cache hits.
size_t gridfire::MultiscalePartitioningEngineView::CacheStats::m_miss = 0 |
Total number of cache misses.
std::map<operators, size_t> gridfire::MultiscalePartitioningEngineView::CacheStats::m_operatorHits |
Map from operators to the number of cache hits for that operator.
std::map<operators, size_t> gridfire::MultiscalePartitioningEngineView::CacheStats::m_operatorMisses |
Map from operators to the number of cache misses for that operator.
std::map<operators, std::string> gridfire::MultiscalePartitioningEngineView::CacheStats::operatorsNameMap |
Map from operators to their string names for logging.