eleme / corvus

A fast and lightweight Redis Cluster Proxy for Redis 3.0
MIT License
789 stars 143 forks source link

monitoring slowlog in Corvus #146

Open georgasa opened 5 years ago

georgasa commented 5 years ago

Hello,

When I set the slowlog-log-slower-than with big values like e.g. "24000", the slowlogs I get are also big e.g.

localhost:6380> config set slowlog-log-slower-than 24000 OK localhost:6380> slowlog reset OK localhost:6380> slowlog get 2 1) 1) (integer) 12417746 2) (integer) 1555674724 3) (integer) 48043 4) (integer) 50242 ...

2) 1) (integer) 12417750 2) (integer) 1555674724 3) (integer) 47861 4) (integer) 48369

In the same environment, when I set the slowlog-log-slower-than with small values "24", the slowlogs I get are also small and the big delays being displayed previously are disappeared:

localhost:6380> config set slowlog-log-slower-than 24 OK localhost:6380> slowlog reset OK localhost:6380> slowlog get 2 1) 1) (integer) 12429661 2) (integer) 1555675090 3) (integer) 775 4) (integer) 807 ... 2) 1) (integer) 12429671 2) (integer) 1555675090 3) (integer) 282 4) (integer) 318

So does Corvus understands the desired time unit (micro, mill, etc) from the config setting it so does display the result accordingly?

By the way, in my environment, the latencies are below 24ms so I can't interpret correctly the numbers like 282 and 318 ...

Thank you

doyoubi commented 5 years ago

The slowlog-log-slower-than and the two latency are in micro-seconds.

The reason that you saw different slowlogs after changing the configs is that the new logs are appended and the old ones get flushed away.