use of zipkin2.elasticsearch.internal.BulkCallBuilder in project zipkin by openzipkin.
the class InternalForTests method writeDependencyLinks.
public static void writeDependencyLinks(ElasticsearchStorage es, List<DependencyLink> links, long midnightUTC) {
String index = ((ElasticsearchSpanConsumer) es.spanConsumer()).formatTypeAndTimestampForInsert("dependency", midnightUTC);
BulkCallBuilder indexer = new BulkCallBuilder(es, es.version(), "indexlinks");
for (DependencyLink link : links) indexer.index(index, "dependency", link, DEPENDENCY_LINK_WRITER);
try {
indexer.build().execute();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of zipkin2.elasticsearch.internal.BulkCallBuilder in project zipkin by openzipkin.
the class BulkRequestBenchmarks method buildAndWriteRequest_singleSpan.
@Benchmark
public HttpRequest buildAndWriteRequest_singleSpan() {
BulkCallBuilder builder = new BulkCallBuilder(es, V6_0, "index-span");
builder.index(spanIndex, "span", CLIENT_SPAN, BulkIndexWriter.SPAN);
HttpCall.RequestSupplier supplier = builder.build().request;
HttpRequestWriter request = HttpRequest.streaming(supplier.headers());
supplier.writeBody(request::tryWrite);
return request;
}
use of zipkin2.elasticsearch.internal.BulkCallBuilder in project zipkin by openzipkin.
the class BulkRequestBenchmarks method buildAndWriteRequest_tenSpans.
@Benchmark
public HttpRequest buildAndWriteRequest_tenSpans() {
BulkCallBuilder builder = new BulkCallBuilder(es, V6_0, "index-span");
for (int i = 0; i < 10; i++) {
builder.index(spanIndex, "span", CLIENT_SPAN, BulkIndexWriter.SPAN);
}
HttpCall.RequestSupplier supplier = builder.build().request;
HttpRequestWriter request = HttpRequest.streaming(supplier.headers());
supplier.writeBody(request::tryWrite);
return request;
}
Aggregations