Skip to content

运行监控

suxb201 edited this page Sep 27, 2022 · 1 revision

运行日志

redis-shake 运行时会周期性打印当前少量监控信息至控制台与 log 文件。通过下面配置项可以控制打印频率等:

[advanced]
# log
log_file = "redis-shake.log"
log_level = "info" # debug, info or warn
log_interval = 5 # in seconds

metrics_port

redis-shake 支持配置 metrics_port,开启一个 port 提供 json 格式的监控信息。

[advanced]
# metric port, 0 means disable
metrics_port = 0

快速使用: 假设配置的 metrics_port 是 1024,使用 curl:

curl 127.0.0.1:1024

返回值:

{
    "address": "10.0.0.217:6379", 
    "entry_id": 3480467, 
    "allow_entries_count": 3480467, 
    "disallow_entries_count": 0, 
    "is_doing_bgsave": false, 
    "rdb_file_size": 656598909, 
    "rdb_received_size": 656598909, 
    "rdb_send_size": 98656256, 
    "aof_received_offset": 1121635825, 
    "aof_applied_offset": 0, 
    "in_queue_entries_count": 1013, 
    "unanswered_bytes_count": 94284
}