API ReferenceUtilities
Info
Get Redis server information and statistics
Syntax
Redix.Info(section, callback)Parameters
Prop
Type
Returns
Prop
Type
Examples
-- Get all information
Redix.Info(function(err, info)
if not err then
print('Redis Info:', info)
end
end)
-- Get specific section
Redix.Info('memory', function(err, memoryInfo)
if not err then
print('Memory Usage:', memoryInfo)
end
end)
-- Get statistics
Redix.Info('stats', function(err, stats)
print('Redis Stats:', stats)
end)Available Sections
- server: General server information
- clients: Connected clients
- memory: Memory usage statistics
- persistence: RDB and AOF information
- stats: General statistics
- replication: Master/replica information
- cpu: CPU usage
- keyspace: Database keys statistics
Use Cases
Monitor Memory Usage
function CheckRedisMemory()
Redix.Info('memory', function(err, info)
if not err then
local used = string.match(info, 'used_memory_human:(%S+)')
print('Redis memory usage:', used)
end
end)
end