本文整理匯總了PHP中Predis\Client::info方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::info方法的具體用法?PHP Client::info怎麽用?PHP Client::info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Predis\Client
的用法示例。
在下文中一共展示了Client::info方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doGetStats
/**
* {@inheritdoc}
*/
protected function doGetStats()
{
$stats = $this->redis->info();
$statsHits = isset($stats['keyspace_hits']) ? $stats['keyspace_hits'] : $stats['Stats']['keyspace_hits'];
$statsMisses = isset($stats['keyspace_misses']) ? $stats['keyspace_misses'] : $stats['Stats']['keyspace_misses'];
$statsMemoryUsage = isset($stats['used_memory']) ? $stats['used_memory'] : $stats['Memory']['used_memory'];
$statsUptime = isset($stats['uptime_in_seconds']) ? $stats['uptime_in_seconds'] : $stats['Server']['uptime_in_seconds'];
return array(Cache::STATS_HITS => $statsHits, Cache::STATS_MISSES => $statsMisses, Cache::STATS_UPTIME => $statsUptime, Cache::STATS_MEMORY_USAGE => $statsMemoryUsage, Cache::STATS_MEMORY_AVAILIABLE => null);
}
示例2: doGetStats
/**
* {@inheritdoc}
*/
protected function doGetStats()
{
$info = $this->client->info();
return array(Cache::STATS_HITS => $info['Stats']['keyspace_hits'], Cache::STATS_MISSES => $info['Stats']['keyspace_misses'], Cache::STATS_UPTIME => $info['Server']['uptime_in_seconds'], Cache::STATS_MEMORY_USAGE => $info['Memory']['used_memory'], Cache::STATS_MEMORY_AVAILABLE => false);
}
示例3: doGetStats
/**
* {@inheritdoc}
*/
protected function doGetStats()
{
$stats = $this->_redis->info();
return array(Cache::STATS_HITS => $stats['keyspace_hits'], Cache::STATS_MISSES => $stats['keyspace_misses'], Cache::STATS_UPTIME => $stats['uptime_in_seconds'], Cache::STATS_MEMORY_USAGE => $stats['used_memory'], Cache::STATS_MEMORY_AVAILIABLE => null);
}