Skip to content

Instantly share code, notes, and snippets.

@webbj74
Created May 15, 2013 21:18
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 webbj74/5587486 to your computer and use it in GitHub Desktop.
Save webbj74/5587486 to your computer and use it in GitHub Desktop.
Acquia Memcache Stats to CSV
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