AdaptiveCache
class AdaptiveCache (View source)
Properties
bool read-only | $enabled | Whether the adaptive cache is enabled for this Relay object. |
|
string read-only | $status | The actual state of the adaptive cache. The user can request an adaptive cache of a certain width and depth, but it is not actually created until Relay attaches to an in-memory endpoint. This can fail if we are out of memory. This property will be ['inactive', 'active']. |
|
int read-only | $width | The underlying count-min sketch width. |
|
int read-only | $depth | The underlying count-min sketch depth. |
|
int read-only | $minEvents | Minimum number of events before a key is cached. |
|
float read-only | $minRatio | Minimum read/write ratio before a key is cached. |
|
string read-only | $formula | The adaptive cache formula ( |
Methods
No description
Returns the estimated load factor.
Flush the adaptive cache.
Returns stats for given key name.
Increment a key's read or write counter by given count.
Get the last time the adaptive cache was flushed.
Details
protected
__construct()
internal |
No description
float|false
loadFactor(int $depth = 1)
Returns the estimated load factor.
bool
flush(bool $async = true)
Flush the adaptive cache.
array|false
stats(string $key)
Returns stats for given key name.
bool
incrBy(string $key, bool $write, int $count)
Increment a key's read or write counter by given count.
float
lastFlush()
Get the last time the adaptive cache was flushed.