Search in sources :

Example 1 with PrimeConnectionEndStats

use of com.netflix.client.PrimeConnections.PrimeConnectionEndStats in project ribbon by Netflix.

the class PrimeConnectionsTest method testPrimeConnectionsSmallPool.

@Test
public void testPrimeConnectionsSmallPool() throws Exception {
    Configuration config = ConfigurationManager.getConfigInstance();
    config.setProperty("PrimeConnectionsTest1.ribbon.NFLoadBalancerClassName", com.netflix.loadbalancer.DynamicServerListLoadBalancer.class.getName());
    config.setProperty("PrimeConnectionsTest1.ribbon.NIWSServerListClassName", SmallFixedServerList.class.getName());
    config.setProperty("PrimeConnectionsTest1.ribbon.EnablePrimeConnections", "true");
    DynamicServerListLoadBalancer<Server> lb = (DynamicServerListLoadBalancer<Server>) ClientFactory.getNamedLoadBalancer("PrimeConnectionsTest1");
    PrimeConnectionEndStats stats = lb.getPrimeConnections().getEndStats();
    assertEquals(stats.success, SMALL_FIXED_SERVER_LIST_SIZE);
}
Also used : Configuration(org.apache.commons.configuration.Configuration) HttpServer(com.sun.net.httpserver.HttpServer) Server(com.netflix.loadbalancer.Server) DynamicServerListLoadBalancer(com.netflix.loadbalancer.DynamicServerListLoadBalancer) PrimeConnectionEndStats(com.netflix.client.PrimeConnections.PrimeConnectionEndStats)

Example 2 with PrimeConnectionEndStats

use of com.netflix.client.PrimeConnections.PrimeConnectionEndStats in project ribbon by Netflix.

the class PrimeConnectionsTest method testPrimeConnectionsLargePool.

@Test
public void testPrimeConnectionsLargePool() throws Exception {
    Configuration config = ConfigurationManager.getConfigInstance();
    config.setProperty("PrimeConnectionsTest2.ribbon.NFLoadBalancerClassName", com.netflix.loadbalancer.DynamicServerListLoadBalancer.class.getName());
    config.setProperty("PrimeConnectionsTest2.ribbon.NIWSServerListClassName", LargeFixedServerList.class.getName());
    config.setProperty("PrimeConnectionsTest2.ribbon.EnablePrimeConnections", "true");
    DynamicServerListLoadBalancer<Server> lb = (DynamicServerListLoadBalancer<Server>) ClientFactory.getNamedLoadBalancer("PrimeConnectionsTest2");
    PrimeConnectionEndStats stats = lb.getPrimeConnections().getEndStats();
    assertEquals(stats.success, LARGE_FIXED_SERVER_LIST_SIZE);
}
Also used : Configuration(org.apache.commons.configuration.Configuration) HttpServer(com.sun.net.httpserver.HttpServer) Server(com.netflix.loadbalancer.Server) DynamicServerListLoadBalancer(com.netflix.loadbalancer.DynamicServerListLoadBalancer) PrimeConnectionEndStats(com.netflix.client.PrimeConnections.PrimeConnectionEndStats)

Aggregations

PrimeConnectionEndStats (com.netflix.client.PrimeConnections.PrimeConnectionEndStats)2 DynamicServerListLoadBalancer (com.netflix.loadbalancer.DynamicServerListLoadBalancer)2 Server (com.netflix.loadbalancer.Server)2 HttpServer (com.sun.net.httpserver.HttpServer)2 Configuration (org.apache.commons.configuration.Configuration)2