Created
May 20, 2018 00:43
-
-
Save Xenofex/abc149aafe76b8ace76856685e027ed8 to your computer and use it in GitHub Desktop.
Search redis keys for a pattern, get total memory usage of all the keys and values of them
This file contains 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
redis-keys-size() { | |
redis-cli keys "$1" | awk '{ system("redis-cli memory usage \x27" $0 "\x27") }' | cut -d ' ' -f 2 | awk '{s+=$1} END {print s}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment