msys.gauge_cache.define

March 26, 2020 Contributors

Name

msys.gauge_cache.define — Create a cache that can be used to maintain a set of counters

Synopsis

msys.gauge_cache.define(name, maxelems, ttl, replicated);

name: string
maxelems: number
ttl: number
replicated: boolean, optional

Description

Creates a cache that can be used to maintain a set of counters based on a string key. The ttl parameter is the number of seconds that a given entry will be maintained after it was last modified, and maxelems is the maximum number of named entries that will be stored in the cache. If a new entry is added, the oldest entry in the cache will be dropped to make room for the new entry. If replicated is set to true, (the default is false), then increments and decrements will be broadcast across the cluster.

Enable this function with the statement require(' msys.gauge_cache ');.

See Also

msys.gauge_cache.inc, msys.gauge_cache.dec, “Shared Gauge Caches”