INFO
The INFO
command in DiceDB is used to retrieve information and statistics about the DiceDB server. This command provides a wealth of information about the server’s status, including memory usage, CPU usage, keyspace statistics, and more. The information is returned in a format that is easy to parse and understand.
Parameters
Optional Section Parameter
section
: (Optional) A string specifying the section of information to retrieve. If no section is specified, the command returns all sections. The available sections are:server
: General information about the DiceDB server.clients
: Client connections information.memory
: Memory usage information.persistence
: Information about RDB and AOF persistence.stats
: General statistics.replication
: Master/slave replication information.cpu
: CPU usage statistics.commandstats
: Command statistics.cluster
: DiceDB Cluster information.keyspace
: Database keyspace statistics.modules
: Information about loaded modules.
Return Value
The INFO
command returns a bulk string containing the requested information. The information is formatted as a series of lines, each containing a key-value pair separated by a colon. Each section is separated by a blank line and starts with a line containing the section name in square brackets.
Example Usage
Retrieve All Information
Retrieve Specific Section Information
Behaviour
When the INFO
command is executed, DiceDB collects and returns the requested information about the server. If no section is specified, it returns all available information. The command does not modify the state of the server or its data; it is purely informational.
Errors
The INFO
command can raise errors in the following scenarios:
-
Invalid Section Name
: If an invalid section name is provided, DiceDB will return an error.Error Message
:ERR unknown INFO subcommand or wrong number of arguments for 'INFO'
-
Syntax Error
: If the command is not used correctly, DiceDB will return a syntax error.Error Message
:ERR syntax error