Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created May 10, 2018 02:05
Show Gist options
  • Save sarjarapu/bc56677b7e5542917b9bff9b7f7b14fc to your computer and use it in GitHub Desktop.
Save sarjarapu/bc56677b7e5542917b9bff9b7f7b14fc to your computer and use it in GitHub Desktop.
A JavaScript function to execute currentOp in a while loop to capture operations over a period of time.
var i = 0;
while(i++<10) {
printjson(db.currentOp());
// sleep for 10 ms if required.
sleep(10)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment