Created
May 15, 2013 21:18
-
-
Save webbj74/5587486 to your computer and use it in GitHub Desktop.
Acquia Memcache Stats to CSV
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
MCINTERVAL=5; HOSTSHORT=`hostname -s`; MCHEADER=`(echo stats; sleep 0.5) | nc -w1 ${HOSTSHORT} 11211 | tr -d "\r\n"`; echo "host,${MCHEADER}" | sed -e 's/STAT \([a-z_]\+\) [0-9.]\+/\1,/g;s/,END//'; while [ 1 = 1 ]; do MCSTATS=`(echo stats; sleep ${MCINTERVAL}) | nc -w1 ${HOSTSHORT} 11211 | tr -d "\r\n"`; echo "${HOSTSHORT}${MCSTATS}" | sed -e 's/STAT [a-z_]\+ /,/g;s/END$//'; done | tee -a /mnt/tmp/sitename/memcache-logs.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment