DefaultSessionStats extends AbstractStats implements SessionStats { @Override public List<AutoReadEvent> getAutoReadEvents() { return autoReadEvents; } DefaultSessionStats(ScheduledExecutorService scheduled); @Override void increaseInputBytes(long bytes); @Override void increaseOutputBytes(long bytes); @Override long lastUpdateTime(); @Override long getInputBytes(); @Override long getOutputBytes(); @Override long getInputInstantaneousBPS(); @Override long getOutputInstantaneousBPS(); @Override List<AutoReadEvent> getAutoReadEvents(); @Override void onInit(); @Override void onEstablished(); @Override void onWritable(); @Override void onNotWritable(); @Override String toString();  }
@Test public void testGetAutoReadEvents() { List<SessionStats.AutoReadEvent> events = sessionStats.getAutoReadEvents(); Assert.assertNotNull(events); Assert.assertTrue(events.isEmpty()); sessionStats.onWritable(); events = sessionStats.getAutoReadEvents(); Assert.assertNotNull(events); Assert.assertTrue(events.isEmpty()); sessionStats.onNotWritable(); sleep(100); sessionStats.onWritable(); Assert.assertNotNull(events); Assert.assertFalse(events.isEmpty()); SessionStats.AutoReadEvent event = events.get(0); logger.info("{}", event); }