(PECL yac >= 1.0.0)
Yac::info — Status of cache
Questa funzione non contiene parametri.
Returns an array with the following keys:
memory_sizeTotal shared memory in use, in bytes: the slot table plus the value blocks.
slots_memory_sizeMemory reserved for the hash slot table, in bytes.
values_memory_sizeMemory reserved for the stored values, in bytes.
segment_sizeSize of one value memory segment, in bytes.
segment_numNumber of value memory segments.
missNumber of cache misses: lookups that found nothing or an expired entry.
hitsNumber of cache hits: successful lookups.
failsNumber of failed stores: stores that could not allocate a value block.
kicksNumber of evictions: how often an existing entry had to be evicted because the candidate slot path was full.
recyclesNumber of times the allocator reached the end of a segment and wrapped around to its beginning.
start_timeThe Unix timestamp at which the shared memory cache was initialized.
slots_sizeTotal number of hash slots.
slots_usedNumber of hash slots currently occupied.
Example #1 Yac::info() example
<?php
$yac = new Yac();
$yac->set("foo", "bar");
print_r($yac->info());
?>Il precedente esempio visualizzerà qualcosa simile a:
Array
(
[memory_size] => 75497472
[slots_memory_size] => 8388608
[values_memory_size] => 67108864
[segment_size] => 4194304
[segment_num] => 16
[miss] => 0
[hits] => 0
[fails] => 0
[kicks] => 0
[recycles] => 0
[start_time] => 1725955200
[slots_size] => 65536
[slots_used] => 1
)
The hit ratio can be computed as hits / (hits + miss);
a growing kicks or fails counter
indicates that the cache is under memory pressure.