mcrl2::utilities::cache_metric

Include file:

#include "mcrl2/utilities/cache_metric.h
class mcrl2::utilities::cache_metric

A helper class to keep track of the number of hits and misses for cache-like data structures.

Private attributes

std::size_t mcrl2::utilities::cache_metric::m_hit_count
std::size_t mcrl2::utilities::cache_metric::m_miss_count

Public member functions

void hit()

Should be called when searching the cache was a hit.

std::string message() const

Returns: A message stating x hits, y misses (z %), where x,y,z indicate the number of hits, misses and percentage respectively.

void miss()

Should be called when searching the cache was a miss.

void reset()

Resets the cache counters.