LongJVMPauseDetector { @Override public String toString() { return S.toString(LongJVMPauseDetector.class, this); } LongJVMPauseDetector(IgniteLogger log); void start(); void stop(); static boolean enabled(); synchronized long getLastWakeUpTime(); synchronized @Nullable IgniteBiTuple<Long, Long> getLastLongPause(); @Override String toString(); static final int DEFAULT_JVM_PAUSE_DETECTOR_THRESHOLD; }
@Test public void testJulMessage() throws Exception { this.strLog = new GridStringLogger(true); strLog.logLength(300000); startGrid(0); assertTrue(strLog.toString().contains("LongJVMPauseDetector was successfully started")); }
@Test public void testStopWorkerThread() throws Exception { strLog = new GridStringLogger(true); strLog.logLength(300_000); startGrid(0); stopGrid(0); String log = strLog.toString(); assertFalse(log.contains("jvm-pause-detector-worker has been interrupted.")); assertTrue(log.contains("jvm-pause-detector-worker has been stopped.")); }