Search in sources :

Example 1 with BackendStatistics

use of com.yahoo.fs4.mplex.Backend.BackendStatistics in project vespa by vespa-engine.

the class BackendTestCase method requireStatistics.

@Test
public void requireStatistics() throws IOException, InvalidChannelException {
    FS4Channel channel = backend.openPingChannel();
    server.dispatch.channelId = -1;
    server.dispatch.packetData = PONG;
    assertTrue(channel.sendPacket(new PingPacket()));
    try {
        channel.receivePackets(1000, 1);
    } catch (ChannelTimeoutException e) {
        fail("Could not get packets from simulated backend.");
    }
    BackendStatistics stats = backend.getStatistics();
    assertEquals(1, stats.totalConnections());
}
Also used : PingPacket(com.yahoo.fs4.PingPacket) ChannelTimeoutException(com.yahoo.fs4.ChannelTimeoutException) BackendStatistics(com.yahoo.fs4.mplex.Backend.BackendStatistics) Test(org.junit.Test)

Aggregations

ChannelTimeoutException (com.yahoo.fs4.ChannelTimeoutException)1 PingPacket (com.yahoo.fs4.PingPacket)1 BackendStatistics (com.yahoo.fs4.mplex.Backend.BackendStatistics)1 Test (org.junit.Test)1