in benchmarks/Elastic.Ingest.Elasticsearch.Benchmarks/Benchmarks/BulkIngestionBenchmarks.cs [33:63]
public void Setup()
{
_data = StockData.CreateSampleData(DocumentsToIndex);
var transport = new DistributedTransport(
new TransportConfiguration(
new SingleNodePool(new("http://localhost:9200")),
new InMemoryRequestInvoker(StockData.CreateSampleDataSuccessWithFilterPathResponseBytes(MaxExportSize))));
#pragma warning disable CS0618 // Type or member is obsolete
_options = new IndexChannelOptions<StockData>(transport)
{
BufferOptions = new Channels.BufferOptions
{
OutboundBufferMaxSize = MaxExportSize
},
DisableDiagnostics = DisableDiagnostics,
UseReadOnlyMemory = UseReadOnlyMemory,
IndexFormat = "stock-data-v8",
OutboundChannelExitedCallback = () => _waitHandle.Set(),
#if DEBUG
ExportResponseCallback = (response, a) =>
{
Interlocked.Add(ref _responses, a.Count);
Console.WriteLine(_responses);
},
PublishToOutboundChannelCallback = () => Console.WriteLine("PUBLISHED")
#endif
};
#pragma warning restore CS0618 // Type or member is obsolete
}