Last active
January 28, 2016 08:28
-
-
Save marcoberri/5ff35ced0a8d3c744008 to your computer and use it in GitHub Desktop.
analyze current Operation
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
| while(1) { | |
| var c = db.currentOp(); | |
| if(c && c.inprog && c.inprog.length > 0 && c.inprog[0].op == 'query') { | |
| var el = c.inprog[0]; | |
| if( el.ns == 'admin.$cmd' || el.ns == 'local.$cmd' || el.ns == '') | |
| continue; | |
| print("on:" + el.ns); | |
| if(el.microsecs_running && el.microsecs_running.floatApprox) | |
| print("time:" + el.microsecs_running.floatApprox); | |
| print("query: " + JSON.stringify(el.query)); | |
| print(); | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment