Skip to main content

NewLRUCacheFilter

Creates a new fastcheck.Filter using an LRU cache of type cache.Cache with a fixed size.

def NewLRUCacheFilter(
size: int,
scope: promutils.Scope
) - > *LRUCacheFilter, error

Create a new fastcheck.Filter using an LRU cache of type cache.Cache with a fixed size

Parameters

NameTypeDescription
sizeintThe maximum number of items the LRU cache can hold.
scopepromutils.ScopeThe Prometheus scope for metrics reporting related to the filter.

Returns

TypeDescription
*LRUCacheFilter, errorA new LRUCacheFilter instance and an error if the cache cannot be created.