728x90
반응형

수행 시간을 주고 세션 모니터링 진행

 

active(1) : 1 이상 수행중인 세션 모니터링

active(0) : 전체 세션

 

function active(ss){

  cop = db.currentOp()

  print ('------------------------------') ;

  print ('Total connections :' , cop.inprog.length) ;

  print ('------------------------------') ;

  print (' ' ) ;

  print ('Over ' , ss ,' secs session List');

  print (' ') ; 

 

  cop.inprog.forEach(function(op){

    els_sec = op.secs_running  ;

if ( els_sec > ss ) {

    print ('   ') ;

    print ( 'Type :' , op.type , '/ Opid :' , op.opid , '/ Kill op : db.killOp(', op.opid, ') / OP info :' , op.desc , '/ Client :' , op.client , '/ Operation :' , op.op , '/ NS :' , op.ns ) ;

    print ( 'Active :' , op.active , '/ Secs_runing :' , els_sec  ) ;

    print ( 'Command :' );

        printjson(        op.command ) ;

    print ('Plan :' ,op.planSummary) ;

    print('Locks waiting :' , op.waitingForLock , '/ Num Yield :' , op.numYields ) ;

        printjson(op.lockStats) ;

    print ('--------------------') ;

}

  }

 )

  print ('------------------------------') ;

  print ('Total connections :' , cop.inprog.length) ;

  print ('------------------------------') ;

}

 

active(1)

728x90
반응형

+ Recent posts