Class CacheMetricTracker

class CacheMetricTracker

Public Functions

CacheMetricTracker(CacheItemType cache_item_type, size_t total_cache_size, size_t max_cache_item_size, int num_gpus = 0)
std::vector<std::shared_ptr<CacheItemMetric>> &getCacheItemMetrics(DeviceIdentifier device_identifier)
std::shared_ptr<CacheItemMetric> getCacheItemMetric(QueryPlanHash key, DeviceIdentifier device_identifier) const
void setCurrentCacheSize(DeviceIdentifier device_identifier, size_t bytes)
std::optional<size_t> getCurrentCacheSize(DeviceIdentifier key) const
std::shared_ptr<CacheItemMetric> putNewCacheItemMetric(QueryPlanHash key, DeviceIdentifier device_identifier, size_t mem_size, size_t compute_time)
void removeCacheItemMetric(QueryPlanHash key, DeviceIdentifier device_identifier)
void removeMetricFromBeginning(DeviceIdentifier device_identifier, int offset)
size_t calculateRequiredSpaceForItemAddition(DeviceIdentifier device_identifier, size_t item_size) const
void clearCacheMetricTracker()
CacheAvailability canAddItem(DeviceIdentifier device_identifier, size_t item_size) const
void updateCurrentCacheSize(DeviceIdentifier device_identifier, CacheUpdateAction action, size_t size)
void sortCacheInfoByQueryMetric(DeviceIdentifier device_identifier)
std::string toString() const
size_t getTotalCacheSize() const
size_t getMaxCacheItemSize() const
void setTotalCacheSize(size_t new_total_cache_size)
void setMaxCacheItemSize(size_t new_max_cache_item_size)

Public Static Functions

static CacheMetricInfoMap::mapped_type::const_iterator getCacheItemMetricItr(QueryPlanHash key, CacheMetricInfoMap::mapped_type const &metrics)
static std::shared_ptr<CacheItemMetric> getCacheItemMetricImpl(QueryPlanHash key, CacheMetricInfoMap::mapped_type const &metrics)

Private Members

CacheItemType item_type_
size_t total_cache_size_
size_t max_cache_item_size_
CacheMetricInfoMap cache_metrics_
CacheSizeMap current_cache_size_in_bytes_