Skip to content

Instantly share code, notes, and snippets.

@yuriyvolkov
Created August 21, 2012 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriyvolkov/3414360 to your computer and use it in GitHub Desktop.
Save yuriyvolkov/3414360 to your computer and use it in GitHub Desktop.
few commands to dig into mongodb profiling data
db.setProfilingLevel(2);
db.getProfilingLevel();
db.getProfilingStatus();
//to see output without $cmd (command) operations
db.system.profile.find( function() { return this.info.indexOf('$cmd')<0; } );
//To view operations for a particular collection
db.system.profile.find( { info: /test.foo/ } );
//To view operations slower than a certain number of milliseconds
db.system.profile.find( { millis : { $gt : 5 } } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment