Created
August 6, 2012 17:11
-
-
Save twerth/3276723 to your computer and use it in GitHub Desktop.
MongoDB profiling
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 | |
mongod -vvvv --profile=2 --logpath /usr/local/var/log/mongodb/mongod.log -f /usr/local/etc/mongod.conf --fork | |
echo 'mongodb started' |
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 | |
# Only show slow queries | |
#tail -f /usr/local/var/log/mongodb/mongod.log | highlight blue 'query:.*}' purple 'nscanned:[0-9]*' purple 'nreturned:[0-9]*' | egrep '[0-9]*[1-9]ms' | |
tail -f /usr/local/var/log/mongodb/mongod.log | highlight blue 'query:.*}' purple 'nscanned:[0-9]*' purple 'nreturned:[0-9]*' green '[0-9]*[0-9]ms' red '[0-9]*[1-9]ms' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment