protected void synchWithTarget(Map<String,Monitor> map) throws MonitorException {
  long timeLimit=System.currentTimeMillis() + syncWaitMs;
  String name="hotspot.rt.hrt.ticks";
  LongMonitor ticks=(LongMonitor)pollFor(map,name,timeLimit);
  log("synchWithTarget: " + lvmid + " ");
  while (ticks.longValue() == 0) {
    log(".");
    try {
      Thread.sleep(20);
    }
 catch (    InterruptedException e) {
    }
    if (System.currentTimeMillis() > timeLimit) {
      lognl("failed: " + lvmid);
      throw new MonitorException("Could Not Synchronize with target");
    }
  }
  lognl("success: " + lvmid);
}

protected void synchWithTarget ( Map < String , Monitor > map ) throws MonitorException { long timeLimit = System . currentTimeMillis ( ) + syncWaitMs ; String name = "hotspot.rt.hrt.ticks" ; LongMonitor ticks = ( LongMonitor ) pollFor ( map , name , timeLimit ) ; log ( "synchWithTarget: " + lvmid + " " ) ; while ( ticks . longValue ( ) == 0 ) { log ( "." ) ; try { Thread . sleep ( 20 ) ; } catch ( InterruptedException e ) { } if ( System . currentTimeMillis ( ) > timeLimit ) { lognl ( "failed: " + lvmid ) ; throw new MonitorException ( "Could Not Synchronize with target" ) ; } } lognl ( "success: " + lvmid ) ; }
method to provide a gross level of synchronization with the target monitored jvm . gross synchronization works by polling for the hotspot . rt . hrt . ticks counter , which is the last counter created by the statsampler initialization code . the counter is updated when the watcher thread starts scheduling tasks , which is the last thing done in vm initialization .
