项目作者: tufanbarisyildirim

项目描述 :
Redis analyzer, analyzes redis keys, groups their size in memory by dbnum and prefix #golang
高级语言: Go
项目地址: git://github.com/tufanbarisyildirim/redis-analyzer.git
创建时间: 2020-01-08T21:14:40Z
项目社区:https://github.com/tufanbarisyildirim/redis-analyzer

开源协议:MIT License

下载


Redis Analyzer

Redis Analyzer is a simple tool to group keys by prefixes and sum their size in memory

requires go 1.13

Usage

```shell script
Usage of ./bin/redis-analyzer:
-addr string
redis host:port (default “127.0.0.1:6379”)
-breakdown int
breakdown count (default 2)
-chunk int
chunk size of key to analyse at once (default 10000)
-db string
specific redis db, or a comma separated db list (default “0”)
-match string
key name filter on scan (default “*”)
-password string
redis connection password
-separator string
key prefix separator (default “:”)

  1. ### Example
  2. ``` shell script
  3. ➜ redis-analyzer ./redis-analyzer --addr=127.0.0.1:6379 --breakdown=2 --db=1,2,3,4
  4. db 3 is empty
  5. db 4 is empty
  6. [db 1] 224/224 --- [====================================================================] 100%
  7. [db 2] 19833/19833 --- [====================================================================] 100%
  8. +----+-----------------------+-------+-----------+
  9. | DB | Prefix | Count | Size |
  10. +----+-----------------------+-------+-----------+
  11. | 1 | mytestproj | 224 | 393.1 KiB |
  12. | | mytestproj:job-status | 107 | 14.5 KiB |
  13. | | mytestproj:job | | 39.1 KiB |
  14. | | mytestproj:all-jobs | 1 | 336.9 KiB |
  15. | | mytestproj:stats | 8 | 2.0 KiB |
  16. | | mytestproj:job-queue | 1 | 552 B |
  17. | | | | |
  18. | 2 | testa | 19833 | 7.0 MiB |
  19. | | testa:autlist | | |
  20. | | | | |
  21. +----+-----------------------+-------+-----------+