Last active
May 28, 2017 16:49
-
-
Save fstern/cdb54c8c3cd2c7f90054dc8182bdc0c7 to your computer and use it in GitHub Desktop.
dm-cache status shell
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
#!/bin/bash | |
set -eo pipefail | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <dm-cache device>" | |
exit 1 | |
fi | |
/sbin/dmsetup status $1 | \ | |
awk '{ rr = ($8/($8+$9))*100 ; wr = ($10/($10+$11))*100; print "meta: " $5 "\ncache: " $7 "\nread: "$8"/"$9, rr"% Hit\nwrite: "$10"/"$11, wr"% Hit\nmove: "$13"/"$12" (promote/demote)\ndirty: "$14 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment