Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. // Sorts current ops so that the worst appear at the bottom where you can see them,
  2. // and only presents information relevant to diagnosing poor application performance
  3. currentSumm = function(){
  4. v = db.currentOp().inprog;
  5. compare = function(a, b) {
  6. if (a.secs_running < b.secs_running || a.secs_running===undefined) return -1;
  7. if (a.secs_running > b.secs_running || b.secs_running===undefined) return 1;
  8. return 0
  9. };
  10. v.sort(compare);
  11. v.forEach(function(s){
  12. print("opid:", s.opid, " op:", s.op, " ns:", s.ns, " secs:", s.secs_running, " desc:", s.desc);
  13. printjson(s.query);
  14. print("-----------------------------------------------------------------");}
  15. );
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement