Package com.firefly.net.buffer

Examples of com.firefly.net.buffer.AdaptiveReceiveBufferSizePredictor.previousReceiveBufferSize()


  private static Log log = LogFactory.getInstance().getLog("firefly-system");

  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));
View Full Code Here


  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
View Full Code Here

  @Test
  public void testAdaptive() {
    ReceiveBufferSizePredictor receiveBufferSizePredictor = new AdaptiveReceiveBufferSizePredictor();
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
View Full Code Here

    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
View Full Code Here

    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), is(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
View Full Code Here

    receiveBufferSizePredictor.previousReceiveBufferSize(1025);
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(1024));

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    log.debug("current buf size: " + receiveBufferSizePredictor.nextReceiveBufferSize());
    Assert.assertThat(receiveBufferSizePredictor.nextReceiveBufferSize(), greaterThan(2000));
  }

  @Test
View Full Code Here

    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(1300);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
View Full Code Here

    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
  }
View Full Code Here

    receiveBufferSizePredictor.previousReceiveBufferSize(4000);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
  }

}
View Full Code Here

    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(960);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    receiveBufferSizePredictor.previousReceiveBufferSize(50);
    System.out.println(receiveBufferSizePredictor.nextReceiveBufferSize());
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.