@Test public void loadTest() throws ExecutionException, InterruptedException, IOException { client = newEventClient(ImmutableSet.of(baseUri)); List<Future<Void>> futures = new ArrayList<>(); for (int i = 0; i < 100; i++) { futures.add(client.post(TestingUtils.getEvents())); } for (Future<Void> future : futures) { future.get(); System.out.println("future " + future); } assertEquals(servlet.lastPath, "/v2/event"); assertEquals(new ObjectMapper().readValue(servlet.lastBody, Object.class), TestingUtils.getExpectedJson(), "JSON encoding " + servlet.lastBody); }
@SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); @Flatten RequestStats getStats(); @SafeVarargs @Override final ListenableFuture<Void> post(T... event); @Override ListenableFuture<Void> post(final Iterable<T> events); }
HttpEventClient implements EventClient { @SafeVarargs @Override public final <T> ListenableFuture<Void> post(T... event) throws IllegalArgumentException { requireNonNull(event, "event is null"); return post(Arrays.asList(event)); } @Inject  HttpEventClient(
            JsonEventWriter eventWriter,
            NodeInfo nodeInfo,
            @ForEventClient HttpClient httpClient); @Flatten RequestStats getStats(); @SafeVarargs @Override final ListenableFuture<Void> post(T... event); @Override ListenableFuture<Void> post(final Iterable<T> events);  }