LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ldes::engine::CacheState Struct Reference

Live state of one Cache node. More...

#include <line/solvers/ldes/ldes_cache.h>

Collaboration diagram for line::ldes::engine::CacheState:

Classes

struct  HeldRequest
 A request parked while its item was being fetched. More...

Public Member Functions

int fetches_item (std::size_t cls) const
 The item cls fetches, or -1.
std::size_t retrieval_of (std::size_t item, std::size_t cls) const
 The retrieval class of item for access class cls, or 0.
int find (std::size_t item) const
 The list holding item, or -1.
double list_cost (std::size_t l) const
double cap_of (std::size_t l) const
bool capped () const
double size_of (std::size_t item) const

Public Attributes

std::size_t node = 0
std::size_t nitems = 0
lang::ReplacementStrategy policy = lang::ReplacementStrategy::LRU
double qlru = 1.0
 q-LRU admission probability on a miss
std::vector< std::size_t > capacity
 per list
std::vector< std::list< std::size_t > > lists
 per list, most recent at the front
std::vector< double > item_size
 empty = unconstrained
std::vector< double > cost_cap
 empty = unconstrained
std::vector< std::vector< double > > popularity
 Per access class: the item popularity, as a cumulative law.
std::vector< int > hit_class
std::vector< int > miss_class
 0-based destination class, -1 = unset
std::vector< double > hits
std::vector< double > misses
 per access class
bool has_retrieval = false
 Cache.setRetrievalSystem: a miss FETCHES the item through a sub-network instead of being served at once, and a second request for an item already in flight is parked rather than starting a fetch of its own.
std::vector< std::vector< std::size_t > > retrieval_class
 (nitems x nclasses) the per-item retrieval class, 0 = none.
std::vector< int > retrieval_class_to_item
 Per class: the item it fetches, or -1 when it is not a retrieval class.
std::vector< char > in_flight
 per item, a fetch is outstanding
std::vector< double > fetch_start
 per item, when that fetch began
std::vector< std::vector< HeldRequest > > held
 per item
std::vector< double > delayed
 per access class, delayed-hit count
double delayed_wait = 0.0
 summed parked time over all releases
double total_fetch_time = 0.0
 summed fetch duration
double completed_fetches = 0.0

Detailed Description

Live state of one Cache node.

Definition at line 44 of file ldes_cache.h.

Member Function Documentation

◆ cap_of()

double line::ldes::engine::CacheState::cap_of ( std::size_t l) const
inline

Definition at line 114 of file ldes_cache.h.

References cost_cap.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

◆ capped()

bool line::ldes::engine::CacheState::capped ( ) const
inline

Definition at line 117 of file ldes_cache.h.

References cost_cap, and item_size.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

◆ fetches_item()

int line::ldes::engine::CacheState::fetches_item ( std::size_t cls) const
inline

The item cls fetches, or -1.

Definition at line 91 of file ldes_cache.h.

References retrieval_class_to_item.

◆ find()

int line::ldes::engine::CacheState::find ( std::size_t item) const
inline

The list holding item, or -1.

Definition at line 101 of file ldes_cache.h.

References lists.

◆ list_cost()

double line::ldes::engine::CacheState::list_cost ( std::size_t l) const
inline

Definition at line 108 of file ldes_cache.h.

References item_size, and lists.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

◆ retrieval_of()

std::size_t line::ldes::engine::CacheState::retrieval_of ( std::size_t item,
std::size_t cls ) const
inline

The retrieval class of item for access class cls, or 0.

Definition at line 95 of file ldes_cache.h.

References retrieval_class.

◆ size_of()

double line::ldes::engine::CacheState::size_of ( std::size_t item) const
inline

Definition at line 118 of file ldes_cache.h.

References item_size.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

Member Data Documentation

◆ capacity

std::vector<std::size_t> line::ldes::engine::CacheState::capacity

per list

Definition at line 49 of file ldes_cache.h.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

◆ completed_fetches

double line::ldes::engine::CacheState::completed_fetches = 0.0

Definition at line 88 of file ldes_cache.h.

◆ cost_cap

std::vector<double> line::ldes::engine::CacheState::cost_cap

empty = unconstrained

Definition at line 52 of file ldes_cache.h.

Referenced by cap_of(), and capped().

◆ delayed

std::vector<double> line::ldes::engine::CacheState::delayed

per access class, delayed-hit count

Definition at line 85 of file ldes_cache.h.

◆ delayed_wait

double line::ldes::engine::CacheState::delayed_wait = 0.0

summed parked time over all releases

Definition at line 86 of file ldes_cache.h.

◆ fetch_start

std::vector<double> line::ldes::engine::CacheState::fetch_start

per item, when that fetch began

Definition at line 75 of file ldes_cache.h.

◆ has_retrieval

bool line::ldes::engine::CacheState::has_retrieval = false

Cache.setRetrievalSystem: a miss FETCHES the item through a sub-network instead of being served at once, and a second request for an item already in flight is parked rather than starting a fetch of its own.

It is released when the fetch returns, and counted as a DELAYED HIT: it neither hit nor missed, and folding it into either loses the whole effect the model exists to measure.

Definition at line 69 of file ldes_cache.h.

◆ held

std::vector<std::vector<HeldRequest> > line::ldes::engine::CacheState::held

per item

Definition at line 83 of file ldes_cache.h.

◆ hit_class

std::vector<int> line::ldes::engine::CacheState::hit_class

Definition at line 55 of file ldes_cache.h.

◆ hits

std::vector<double> line::ldes::engine::CacheState::hits

Definition at line 58 of file ldes_cache.h.

◆ in_flight

std::vector<char> line::ldes::engine::CacheState::in_flight

per item, a fetch is outstanding

Definition at line 74 of file ldes_cache.h.

◆ item_size

std::vector<double> line::ldes::engine::CacheState::item_size

empty = unconstrained

Definition at line 51 of file ldes_cache.h.

Referenced by capped(), list_cost(), and size_of().

◆ lists

std::vector<std::list<std::size_t> > line::ldes::engine::CacheState::lists

per list, most recent at the front

Definition at line 50 of file ldes_cache.h.

Referenced by line::ldes::engine::cache_hit(), line::ldes::engine::cache_miss(), find(), and list_cost().

◆ miss_class

std::vector<int> line::ldes::engine::CacheState::miss_class

0-based destination class, -1 = unset

Definition at line 55 of file ldes_cache.h.

◆ misses

std::vector<double> line::ldes::engine::CacheState::misses

per access class

Definition at line 58 of file ldes_cache.h.

◆ nitems

std::size_t line::ldes::engine::CacheState::nitems = 0

Definition at line 46 of file ldes_cache.h.

◆ node

std::size_t line::ldes::engine::CacheState::node = 0

Definition at line 45 of file ldes_cache.h.

◆ policy

lang::ReplacementStrategy line::ldes::engine::CacheState::policy = lang::ReplacementStrategy::LRU

Definition at line 47 of file ldes_cache.h.

Referenced by line::ldes::engine::cache_hit(), and line::ldes::engine::cache_miss().

◆ popularity

std::vector<std::vector<double> > line::ldes::engine::CacheState::popularity

Per access class: the item popularity, as a cumulative law.

Definition at line 54 of file ldes_cache.h.

◆ qlru

double line::ldes::engine::CacheState::qlru = 1.0

q-LRU admission probability on a miss

Definition at line 48 of file ldes_cache.h.

Referenced by line::ldes::engine::cache_miss().

◆ retrieval_class

std::vector<std::vector<std::size_t> > line::ldes::engine::CacheState::retrieval_class

(nitems x nclasses) the per-item retrieval class, 0 = none.

1-based.

Definition at line 71 of file ldes_cache.h.

Referenced by retrieval_of().

◆ retrieval_class_to_item

std::vector<int> line::ldes::engine::CacheState::retrieval_class_to_item

Per class: the item it fetches, or -1 when it is not a retrieval class.

Definition at line 73 of file ldes_cache.h.

Referenced by fetches_item().

◆ total_fetch_time

double line::ldes::engine::CacheState::total_fetch_time = 0.0

summed fetch duration

Definition at line 87 of file ldes_cache.h.


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