Search in sources :

Example 11 with ClusterPropertiesJsonSerializer

use of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer in project rest.li by linkedin.

the class SimpleLoadBalancerTest method testLoadBalancerSimulationDegraderWithFileStore.

@Test(groups = { "medium", "back-end" })
public void testLoadBalancerSimulationDegraderWithFileStore() throws URISyntaxException, IOException, ServiceUnavailableException, InterruptedException {
    SimpleLoadBalancerSimulation simulator = new SimpleLoadBalancerSimulation(new DegraderLoadBalancerStrategyFactoryV3(), new FileStoreTestFactory<ClusterProperties>("cluster", new ClusterPropertiesJsonSerializer()), new FileStoreTestFactory<ServiceProperties>("service", new ServicePropertiesJsonSerializer()), new FileStoreTestFactory<UriProperties>("uri", new UriPropertiesJsonSerializer()));
    simulator.simulateMultithreaded(1, 1000, 20);
    simulator.reset();
    simulator.simulateMultithreaded(50, 10000, 20);
    simulator.reset();
}
Also used : UriPropertiesJsonSerializer(com.linkedin.d2.balancer.properties.UriPropertiesJsonSerializer) ServiceProperties(com.linkedin.d2.balancer.properties.ServiceProperties) DegraderLoadBalancerStrategyFactoryV3(com.linkedin.d2.balancer.strategies.degrader.DegraderLoadBalancerStrategyFactoryV3) ClusterPropertiesJsonSerializer(com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer) ServicePropertiesJsonSerializer(com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer) UriProperties(com.linkedin.d2.balancer.properties.UriProperties) ClusterProperties(com.linkedin.d2.balancer.properties.ClusterProperties) SimpleLoadBalancerSimulation(com.linkedin.d2.balancer.simulator.SimpleLoadBalancerSimulation) Test(org.testng.annotations.Test)

Example 12 with ClusterPropertiesJsonSerializer

use of com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer in project rest.li by linkedin.

the class SimpleLoadBalancerTest method testLoadBalancerSimulationDegraderWithFileStoreLarge.

@Test(enabled = false, groups = { "large", "back-end" })
public void testLoadBalancerSimulationDegraderWithFileStoreLarge() throws URISyntaxException, IOException, ServiceUnavailableException, InterruptedException {
    SimpleLoadBalancerSimulation simulator = new SimpleLoadBalancerSimulation(new DegraderLoadBalancerStrategyFactoryV3(), new FileStoreTestFactory<ClusterProperties>("cluster", new ClusterPropertiesJsonSerializer()), new FileStoreTestFactory<ServiceProperties>("service", new ServicePropertiesJsonSerializer()), new FileStoreTestFactory<UriProperties>("uri", new UriPropertiesJsonSerializer()));
    simulator.simulateMultithreaded(1, 1000, 20);
    simulator.reset();
    simulator.simulateMultithreaded(1, 10000, 20);
    simulator.reset();
    simulator.simulateMultithreaded(8, 10000, 750);
    simulator.reset();
    simulator.simulateMultithreaded(50, 10000, 100);
    simulator.reset();
    simulator.simulateMultithreaded(50, 10000, 100);
    simulator.reset();
}
Also used : UriPropertiesJsonSerializer(com.linkedin.d2.balancer.properties.UriPropertiesJsonSerializer) ServiceProperties(com.linkedin.d2.balancer.properties.ServiceProperties) DegraderLoadBalancerStrategyFactoryV3(com.linkedin.d2.balancer.strategies.degrader.DegraderLoadBalancerStrategyFactoryV3) ClusterPropertiesJsonSerializer(com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer) ServicePropertiesJsonSerializer(com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer) UriProperties(com.linkedin.d2.balancer.properties.UriProperties) ClusterProperties(com.linkedin.d2.balancer.properties.ClusterProperties) SimpleLoadBalancerSimulation(com.linkedin.d2.balancer.simulator.SimpleLoadBalancerSimulation) Test(org.testng.annotations.Test)

Aggregations

ClusterPropertiesJsonSerializer (com.linkedin.d2.balancer.properties.ClusterPropertiesJsonSerializer)12 ClusterProperties (com.linkedin.d2.balancer.properties.ClusterProperties)11 ServicePropertiesJsonSerializer (com.linkedin.d2.balancer.properties.ServicePropertiesJsonSerializer)10 ServiceProperties (com.linkedin.d2.balancer.properties.ServiceProperties)9 UriProperties (com.linkedin.d2.balancer.properties.UriProperties)9 UriPropertiesJsonSerializer (com.linkedin.d2.balancer.properties.UriPropertiesJsonSerializer)9 UriPropertiesMerger (com.linkedin.d2.balancer.properties.UriPropertiesMerger)7 ZooKeeperPermanentStore (com.linkedin.d2.discovery.stores.zk.ZooKeeperPermanentStore)6 HashMap (java.util.HashMap)6 None (com.linkedin.common.util.None)5 ZKConnection (com.linkedin.d2.discovery.stores.zk.ZKConnection)5 Test (org.testng.annotations.Test)5 FutureCallback (com.linkedin.common.callback.FutureCallback)4 DegraderLoadBalancerStrategyFactoryV3 (com.linkedin.d2.balancer.strategies.degrader.DegraderLoadBalancerStrategyFactoryV3)4 ZooKeeperEphemeralStore (com.linkedin.d2.discovery.stores.zk.ZooKeeperEphemeralStore)4 SimpleLoadBalancer (com.linkedin.d2.balancer.simple.SimpleLoadBalancer)3 SimpleLoadBalancerState (com.linkedin.d2.balancer.simple.SimpleLoadBalancerState)3 PropertyEventBusImpl (com.linkedin.d2.discovery.event.PropertyEventBusImpl)3 List (java.util.List)3 PartitionData (com.linkedin.d2.balancer.properties.PartitionData)2