Created
August 26, 2013 19:33
-
-
Save gjedeer/6345625 to your computer and use it in GitHub Desktop.
Show Varnish cache utilization in percents and megabytes
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
v_bytes=`varnishstat -1 | grep s0.g_bytes | awk '{print $2}'` | |
v_space=`varnishstat -1 | grep s0.g_space | awk '{print $2}'` | |
v_total=$(( v_bytes + v_space )) | |
v_percent=$(( 100 * v_bytes / v_total )) | |
v_total_mb=$(( v_total/1024/1024 )) | |
v_bytes_mb=$(( v_bytes/1024/1024 )) | |
echo $v_percent % \($v_bytes_mb / $v_total_mb MB\) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment