Created
September 8, 2011 08:34
-
-
Save muhqu/1202932 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
DB_URL=http://localhost:5984 | |
DB_READS_300=$(curl -sg $DB_URL'/_stats/couchdb/database_reads?range=300' \ | |
| python -m 'json.tool' \ | |
| grep current \ | |
| sed -e 's/[^0-9\.]//g' \ | |
|| echo 0) | |
DB_READS_SEC=$(echo "scale=4; $DB_READS_300/300" | bc) | |
DB_WRITES_300=$(curl -sg $DB_URL'/_stats/couchdb/database_writes?range=300' \ | |
| python -m 'json.tool' \ | |
| grep current \ | |
| sed -e 's/[^0-9\.]//g' \ | |
|| echo 0) | |
DB_WRITES_SEC=$(echo "scale=4; $DB_WRITES_300/300" | bc) | |
echo "Couch Database Reads per sec, 5min avg : $DB_READS_SEC" | |
echo "Couch Database Writes per sec, 5min avg : $DB_WRITES_SEC" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment