Benchmarks for metrics modified to have a metric reader (#4974)
This commit is contained in:
parent
faa70be1b3
commit
637ddcfe4c
|
|
@ -139,9 +139,14 @@ public class AspNetCoreInstrumentationNewBenchmarks
|
|||
this.StartWebApplication();
|
||||
this.httpClient = new HttpClient();
|
||||
|
||||
var exportedItems = new List<Metric>();
|
||||
this.meterProvider = Sdk.CreateMeterProviderBuilder()
|
||||
.ConfigureServices(services => services.AddSingleton<IConfiguration>(configuration))
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddInMemoryExporter(exportedItems, metricReaderOptions =>
|
||||
{
|
||||
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
|
||||
})
|
||||
.Build();
|
||||
}
|
||||
else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
|
||||
|
|
@ -155,9 +160,14 @@ public class AspNetCoreInstrumentationNewBenchmarks
|
|||
.AddAspNetCoreInstrumentation()
|
||||
.Build();
|
||||
|
||||
var exportedItems = new List<Metric>();
|
||||
this.meterProvider = Sdk.CreateMeterProviderBuilder()
|
||||
.ConfigureServices(services => services.AddSingleton<IConfiguration>(configuration))
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddInMemoryExporter(exportedItems, metricReaderOptions =>
|
||||
{
|
||||
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
|
||||
})
|
||||
.Build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,13 @@ public class HttpClientInstrumentationBenchmarks
|
|||
this.StartWebApplication();
|
||||
this.httpClient = new HttpClient();
|
||||
|
||||
var exportedItems = new List<Metric>();
|
||||
this.meterProvider = Sdk.CreateMeterProviderBuilder()
|
||||
.AddHttpClientInstrumentation()
|
||||
.AddInMemoryExporter(exportedItems, metricReaderOptions =>
|
||||
{
|
||||
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
|
||||
})
|
||||
.Build();
|
||||
}
|
||||
else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
|
||||
|
|
@ -106,8 +111,13 @@ public class HttpClientInstrumentationBenchmarks
|
|||
.AddHttpClientInstrumentation()
|
||||
.Build();
|
||||
|
||||
var exportedItems = new List<Metric>();
|
||||
this.meterProvider = Sdk.CreateMeterProviderBuilder()
|
||||
.AddHttpClientInstrumentation()
|
||||
.AddInMemoryExporter(exportedItems, metricReaderOptions =>
|
||||
{
|
||||
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
|
||||
})
|
||||
.Build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue