@Test public void testSampleOccurred() throws InterruptedException { System.out.println("sampleOccurred"); SampleResult res = new SampleResult(); res.setResponseCode("200"); SampleEvent se = new SampleEvent(res, "testTG"); ConsoleStatusLogger instance = new ConsoleStatusLogger(); instance.testStarted(); instance.sampleOccurred(se); instance.sampleOccurred(se); Thread.sleep(1020); instance.sampleOccurred(se); instance.sampleOccurred(se); Thread.sleep(1020); instance.sampleOccurred(se); instance.sampleOccurred(se); }
@Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
        NoThreadClone, TestStateListener { @Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); } }
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
        NoThreadClone, TestStateListener { @Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }  }
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
        NoThreadClone, TestStateListener { @Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }  @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string); }
ConsoleStatusLogger extends AbstractListenerElement implements SampleListener, Serializable,
        NoThreadClone, TestStateListener { @Override public synchronized void sampleOccurred(SampleEvent se) { long sec = System.currentTimeMillis() / 1000; if (sec != cur && count > 0) { if (cur == 0) { begin = sec; } log.debug(cur + " " + begin); flush(sec - begin); cur = sec; } SampleResult res = se.getResult(); count++; sumRTime += res.getTime(); sumLatency += res.getLatency(); errors += res.isSuccessful() ? 0 : 1; threads = res.getAllThreads(); }  @Override synchronized void sampleOccurred(SampleEvent se); @Override void sampleStarted(SampleEvent se); @Override void sampleStopped(SampleEvent se); @Override void testStarted(); @Override void testStarted(String string); @Override void testEnded(); @Override void testEnded(String string);  }