use of com.netflix.hystrix.metric.HystrixRequestEvents in project Hystrix by Netflix.
the class SerialHystrixRequestEventsTest method testCollapsedBatchOfOne.
@Test
public void testCollapsedBatchOfOne() throws IOException {
List<HystrixInvokableInfo<?>> executions = new ArrayList<HystrixInvokableInfo<?>>();
executions.add(new SimpleExecution(fooKey, 53, collapserKey, 1, HystrixEventType.SUCCESS));
HystrixRequestEvents request = new HystrixRequestEvents(executions);
String actual = SerialHystrixRequestEvents.toJsonString(request);
assertEquals("[{\"name\":\"Foo\",\"events\":[\"SUCCESS\"],\"latencies\":[53],\"collapsed\":{\"name\":\"FooCollapser\",\"count\":1}}]", actual);
}
use of com.netflix.hystrix.metric.HystrixRequestEvents in project Hystrix by Netflix.
the class SerialHystrixRequestEventsTest method testCollapsedBatchOfSix.
@Test
public void testCollapsedBatchOfSix() throws IOException {
List<HystrixInvokableInfo<?>> executions = new ArrayList<HystrixInvokableInfo<?>>();
executions.add(new SimpleExecution(fooKey, 53, collapserKey, 6, HystrixEventType.SUCCESS));
HystrixRequestEvents request = new HystrixRequestEvents(executions);
String actual = SerialHystrixRequestEvents.toJsonString(request);
assertEquals("[{\"name\":\"Foo\",\"events\":[\"SUCCESS\"],\"latencies\":[53],\"collapsed\":{\"name\":\"FooCollapser\",\"count\":6}}]", actual);
}
use of com.netflix.hystrix.metric.HystrixRequestEvents in project Hystrix by Netflix.
the class SerialHystrixRequestEventsTest method testSingleThreadPoolRejectedFallbackSuccess.
@Test
public void testSingleThreadPoolRejectedFallbackSuccess() throws IOException {
List<HystrixInvokableInfo<?>> executions = new ArrayList<HystrixInvokableInfo<?>>();
executions.add(new SimpleExecution(fooKey, 1, HystrixEventType.THREAD_POOL_REJECTED, HystrixEventType.FALLBACK_SUCCESS));
HystrixRequestEvents request = new HystrixRequestEvents(executions);
String actual = SerialHystrixRequestEvents.toJsonString(request);
assertEquals("[{\"name\":\"Foo\",\"events\":[\"THREAD_POOL_REJECTED\",\"FALLBACK_SUCCESS\"],\"latencies\":[1]}]", actual);
}
Aggregations