Skip to content

Instantly share code, notes, and snippets.

@henryoswald
Created November 17, 2014 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryoswald/552d1a2a747f01537577 to your computer and use it in GitHub Desktop.
Save henryoswald/552d1a2a747f01537577 to your computer and use it in GitHub Desktop.
process redis db
sort -t"," -n -k4 memory.csv > sorted.csv
grep "DocOps" sorted.csv> docops.csv
grep "sess" sorted.csv> sess.csv
grep "doclines" sorted.csv> doclines.csv
grep "tpds" sorted.csv> tpds.csv
grep UncompressedHistoryOps sorted.csv> historyops.csv
grep "project_last_updated" sorted.csv> lastupdated.csv
cat sorted.csv | grep -v "tpds-rev-mapper" | grep -v "sess" | grep -v "project_last_updated" | grep -v "UncompressedHistoryOps" | grep -v "DocOps" | grep -v "doclines" | grep -v "tpds" > other.csv
echo "Sess :" && awk -F ',' '{ x = x + $4 } END { print x }' sess.csv
echo "Docops:" && awk -F ',' '{ x = x + $4 } END { print x }' docops.csv
echo "Doclines:" && awk -F ',' '{ x = x + $4 } END { print x }' doclines.csv
echo "tpds :" && awk -F ',' '{ x = x + $4 } END { print x }' tpds.csv
echo "historyops :" && awk -F ',' '{ x = x + $4 } END { print x }' historyops.csv
echo "lastupdated:" && awk -F ',' '{ x = x + $4 } END { print x }' lastupdated.csv
echo "other:" && awk -F ',' '{ x = x + $4 } END { print x }' other.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment