Last active
August 30, 2018 18:30
-
-
Save napolux/e2489c1de9a070f7e4d211c12b6c6afc to your computer and use it in GitHub Desktop.
Print the size of redis keys in a readable way (I use it for sets)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for SET in `redis-cli --scan --pattern 'set:*'` | |
do | |
printf "%s\t%s\n" $SET `redis-cli SCARD $SET` | |
done | |
# example output | |
# set:2454148031 33 | |
# set:1497228031 1932 | |
# set:524015031 418 | |
# set:412600031 264 | |
# set:635016031 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment