Skip to content

Commit

Permalink
mysql-slave-stats.sh: always includes zeros
Browse files Browse the repository at this point in the history
I forgot that pipe-to-graphite doesn't take arguments after the command
sow we can't use the --include-zeros. Let's just make it the default
cause it only adds a few metrics and missing values is annoying.
  • Loading branch information
danielbeardsley committed Mar 25, 2015
1 parent 09cad38 commit 1da440b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions scripts/mysql-slave-stats.sh
@@ -1,21 +1,10 @@
#!/bin/sh


if [ "$1" == "--include-zeros" ]; then
# print all lines
awk_command='{ print }'
else
# Remove all the lines where the value is 0
# (~50% of the 360 values were 0 when I checked)
awk_command='{if ($2) print}'
fi

# Produce a huge number of stats about mysql
mysql -u root -e "show slave status \G" |
# Skip the first line (column headers "Variable_name Value")
tail -n +2 |
# command from above
awk "$awk_command" |
# lower-case everything because Capitals_with_underscores_are_annoying
tr '[A-Z]' '[a-z]' |
# 1. Remove leading spaces (from ragged-left edge) and prepend namespace.
Expand Down

0 comments on commit 1da440b

Please sign in to comment.