-r 选项重复执行一个命令指定的次数
-i 设置命令执行的间隔。
比如查看redis每秒执行的commands(qps)
# redis-cli -p 6379 -r 100 -i 1 info stats | grep instantaneous_ops_per_sec
instantaneous_ops_per_sec:0
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
instantaneous_ops_per_sec:1
2.后台进程监控
/apps/sh/tool/nosql_stat --help
Unknown option: help
==========================================================================================
Usage :
Command line options :
-h,--host=s IP address.
-p,--port=i Port
-i,--interval Time(second) Interval. Default : 1
-l,--logfile Print to Logfile. One day a logfile,the suffix of logfile is 'yyyy-mm-dd';
-m Memcache Monitor. Default : Redis Monitor
Sample :
shell> nohup ./nosql_stat --host 127.0.0.1 --port 6379 -i 10 -l /tmp/redis_stat > /dev/null 2>&1 &
Tip : logfile name is redis_stat.2017-09-13
perl /apps/sh/tool/nosql_stat -i 1 -h 127.0.0.1 -p 6921 -l /apps/logs/redis/redis_stat_6921

浙公网安备 33010602011771号