Lately I played mongodb a bit and I encountered this situation:
I want to figure out how many connections have been established between my client and mongodb server when I run the test code.
Though I figured out later that the log file contain such information, I managed to use ‘watch’ to do such a job, which could be applied to other cases. Here it is:
watch -d -n 0.1 'netstat -p -an|grep mongo'