AdaptiveCache
class AdaptiveCache
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 either |
|
| int read-only | $width | The underlying count-min sketch width. |
|
| int read-only | $depth | The underlying count-min sketch depth. |
|
| int read-only | $minEvents | Number of events (reads + writes) a key needs before |
|
| 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 of the count-min sketch as a percentage (0-100),
or 0.0 when the adaptive cache is inactive.
Flush the adaptive cache.
Returns the estimated read and write counts for the given key, or false when the
adaptive cache is inactive.
Increment a key's read or write counter by given count.
Get the last time the adaptive cache was flushed.
Details
at line 79
protected
__construct()
| internal |
No description
at line 91
float|false
loadFactor(int $depth = 1)
Returns the estimated load factor of the count-min sketch as a percentage (0-100),
or 0.0 when the adaptive cache is inactive.
Only the first $depth rows of the sketch are considered; a value below 1 or above
the sketch's depth considers all of them.
at line 100
bool
flush(bool $async = true)
Flush the adaptive cache.
at line 110
array|false
stats(string $key)
Returns the estimated read and write counts for the given key, or false when the
adaptive cache is inactive.
at line 121
bool
incrBy(string $key, bool $write, int $count = 1)
Increment a key's read or write counter by given count.
at line 129
float
lastFlush()
Get the last time the adaptive cache was flushed.