mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 11:54:31 +02:00
Add getStats() method for MemoryCaches
This commit is contained in:
parent
ffb621f0e4
commit
01296e98f9
12 changed files with 170 additions and 0 deletions
|
@ -35,4 +35,18 @@ class APCuCacheTest extends MemoryCacheTestCase
|
|||
$this->cache->clear(false);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @small
|
||||
*/
|
||||
public function testStats()
|
||||
{
|
||||
$stats = $this->instance->getStats();
|
||||
|
||||
self::assertNotNull($stats['entries']);
|
||||
self::assertNotNull($stats['used_memory']);
|
||||
self::assertNotNull($stats['hits']);
|
||||
self::assertNotNull($stats['misses']);
|
||||
self::assertNotNull($stats['avail_mem']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,4 +59,21 @@ class MemcacheCacheTest extends MemoryCacheTestCase
|
|||
{
|
||||
static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
|
||||
}
|
||||
|
||||
/**
|
||||
* @small
|
||||
*/
|
||||
public function testStats()
|
||||
{
|
||||
$stats = $this->instance->getStats();
|
||||
|
||||
self::assertNotNull($stats['version']);
|
||||
self::assertIsNumeric($stats['hits']);
|
||||
self::assertIsNumeric($stats['misses']);
|
||||
self::assertIsNumeric($stats['evictions']);
|
||||
self::assertIsNumeric($stats['entries']);
|
||||
self::assertIsNumeric($stats['used_memory']);
|
||||
self::assertGreaterThan(0, $stats['connected_clients']);
|
||||
self::assertGreaterThan(0, $stats['uptime']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,4 +58,21 @@ class MemcachedCacheTest extends MemoryCacheTestCase
|
|||
{
|
||||
static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
|
||||
}
|
||||
|
||||
/**
|
||||
* @small
|
||||
*/
|
||||
public function testStats()
|
||||
{
|
||||
$stats = $this->instance->getStats();
|
||||
|
||||
self::assertNotNull($stats['version']);
|
||||
self::assertIsNumeric($stats['hits']);
|
||||
self::assertIsNumeric($stats['misses']);
|
||||
self::assertIsNumeric($stats['evictions']);
|
||||
self::assertIsNumeric($stats['entries']);
|
||||
self::assertIsNumeric($stats['used_memory']);
|
||||
self::assertGreaterThan(0, $stats['connected_clients']);
|
||||
self::assertGreaterThan(0, $stats['uptime']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,4 +57,21 @@ class RedisCacheTest extends MemoryCacheTestCase
|
|||
$this->cache->clear(false);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @small
|
||||
*/
|
||||
public function testStats()
|
||||
{
|
||||
$stats = $this->instance->getStats();
|
||||
|
||||
self::assertNotNull($stats['version']);
|
||||
self::assertIsNumeric($stats['hits']);
|
||||
self::assertIsNumeric($stats['misses']);
|
||||
self::assertIsNumeric($stats['evictions']);
|
||||
self::assertIsNumeric($stats['entries']);
|
||||
self::assertIsNumeric($stats['used_memory']);
|
||||
self::assertGreaterThan(0, $stats['connected_clients']);
|
||||
self::assertGreaterThan(0, $stats['uptime']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue