info

PHP Redis

info

Description

Returns an associative array from REDIS that provides information about the server. Passing no arguments to INFO will call the standard REDIS INFO command, which returns information such as the following:

返回redis的相关系统信息,类似于PHP的PHPINFO();可以选择参数,按照选择的参数返回相应的信息,也可以不写参数,返回所有的信息。

  • redis_version
  • arch_bits
  • uptime_in_seconds
  • uptime_in_days
  • connected_clients
  • connected_slaves
  • used_memory
  • changes_since_last_save
  • bgsave_in_progress
  • last_save_time
  • total_connections_received
  • total_commands_processed
  • role

You can pass a variety of options to INFO (per the Redis documentation), which will modify what is returned.

Parameters

option: The option to provide redis (e.g. "COMMANDSTATS", "CPU")

Example
$redis->info(); /* standard redis INFO command */
$redis->info("COMMANDSTATS"); /* Information on the commands that have been run (>=2.6 only)
$redis->info("CPU"); /* just CPU information from Redis INFO */