Control `MemoryDiagnoser` benchmark option via CLI instead of code (#3085)
This commit is contained in:
parent
89a740e20a
commit
c261a67005
|
|
@ -20,7 +20,6 @@ using OpenTelemetry.Internal;
|
|||
|
||||
namespace OpenTelemetry.Benchmarks
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class EventSourceBenchmarks
|
||||
{
|
||||
[Benchmark]
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ using OpenTelemetry.Internal;
|
|||
|
||||
namespace Benchmarks.Exporter
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class JaegerExporterBenchmarks
|
||||
{
|
||||
private Activity activity;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ using OtlpCollector = OpenTelemetryProtocol::Opentelemetry.Proto.Collector.Trace
|
|||
|
||||
namespace Benchmarks.Exporter
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class OtlpGrpcExporterBenchmarks
|
||||
{
|
||||
private OtlpTraceExporter exporter;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ using OpenTelemetryProtocol::OpenTelemetry.Exporter.OpenTelemetryProtocol.Implem
|
|||
|
||||
namespace Benchmarks.Exporter
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class OtlpHttpExporterBenchmarks
|
||||
{
|
||||
private readonly byte[] buffer = new byte[1024 * 1024];
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ using Prometheus::OpenTelemetry.Exporter.Prometheus;
|
|||
|
||||
namespace Benchmarks.Exporter
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class PrometheusSerializerBenchmarks
|
||||
{
|
||||
private readonly List<Metric> metrics = new();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ using Zipkin::OpenTelemetry.Exporter;
|
|||
|
||||
namespace Benchmarks.Exporter
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
#if !NET462
|
||||
[ThreadingDiagnoser]
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ using OpenTelemetry.Instrumentation;
|
|||
namespace Benchmarks.Instrumentation
|
||||
{
|
||||
[InProcess]
|
||||
[MemoryDiagnoser]
|
||||
public class DiagnosticSourceSubscriberBenchmark
|
||||
{
|
||||
[Params(1, 2)]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ using Benchmarks.Helper;
|
|||
namespace Benchmarks.Instrumentation
|
||||
{
|
||||
[InProcess]
|
||||
[MemoryDiagnoser]
|
||||
public class InstrumentedAspNetCoreBenchmark
|
||||
{
|
||||
private const string LocalhostUrl = "http://localhost:5050";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ using OpenTelemetry.Trace;
|
|||
|
||||
namespace Benchmarks.Instrumentation
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class InstrumentedHttpClientBenchmark
|
||||
{
|
||||
private const string ActivityName = "incoming request";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ using Benchmarks.Helper;
|
|||
namespace Benchmarks.Instrumentation
|
||||
{
|
||||
[InProcess]
|
||||
[MemoryDiagnoser]
|
||||
public class UninstrumentedAspNetCoreBenchmark
|
||||
{
|
||||
private const string LocalhostUrl = "http://localhost:5050";
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ using OpenTelemetry.Tests;
|
|||
|
||||
namespace Benchmarks.Instrumentation
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class UninstrumentedHttpClientBenchmark
|
||||
{
|
||||
private IDisposable serverLifeTime;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ Intel Core i7-4790 CPU 3.60GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
|
|||
|
||||
namespace Benchmarks.Logs
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class LogBenchmarks
|
||||
{
|
||||
private readonly ILogger loggerWithNoListener;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ using OpenTelemetry.Logs;
|
|||
|
||||
namespace Benchmarks.Logs
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class LogScopeBenchmarks
|
||||
{
|
||||
private readonly LoggerExternalScopeProvider scopeProvider = new();
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ Intel Core i7-9700 CPU 3.00GHz, 1 CPU, 8 logical and 8 physical cores
|
|||
|
||||
namespace Benchmarks.Metrics
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class HistogramBenchmarks
|
||||
{
|
||||
private const int MaxValue = 1000;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R), 1 CPU, 8 logical and 4 physical c
|
|||
|
||||
namespace Benchmarks.Metrics
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class MetricCollectBenchmarks
|
||||
{
|
||||
private readonly string[] dimensionValues = new string[] { "DimVal1", "DimVal2", "DimVal3", "DimVal4", "DimVal5", "DimVal6", "DimVal7", "DimVal8", "DimVal9", "DimVal10" };
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ Intel Core i7-9700 CPU 3.00GHz, 1 CPU, 8 logical and 8 physical cores
|
|||
|
||||
namespace Benchmarks.Metrics
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class MetricsBenchmarks
|
||||
{
|
||||
private readonly Random random = new();
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R), 1 CPU, 8 logical and 4 physical c
|
|||
|
||||
namespace Benchmarks.Metrics
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class MetricsViewBenchmarks
|
||||
{
|
||||
private static readonly ThreadLocal<Random> ThreadLocalRandom = new(() => new Random());
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
# OpenTelemetry Benchmarks
|
||||
|
||||
Use the following example to run Benchmarks from command line:
|
||||
(change parameters as necessary)
|
||||
|
||||
Navigate to `./test/Benchmarks` directory and run the following command:
|
||||
|
||||
```sh
|
||||
dotnet run --framework net6.0 --configuration Release --filter *TraceBenchmarks*
|
||||
dotnet run -c Release -f net6.0 -- -m
|
||||
```
|
||||
|
||||
[How to use console arguments](https://benchmarkdotnet.org/articles/guides/console-args.html)
|
||||
|
||||
- `-m` enables MemoryDiagnoser and prints memory statistics
|
||||
- `-f` allows you to filter the benchmarks by their full name using glob patterns
|
||||
- `dotnet run -c Release -f net6.0 -- -f *TraceBenchmarks*`
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
|
|||
|
||||
namespace Benchmarks.Trace
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class OpenTelemetrySdkBenchmarks
|
||||
{
|
||||
private Tracer alwaysSampleTracer;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ using OpenTelemetry.Trace;
|
|||
|
||||
namespace Benchmarks.Trace
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class OpenTelemetrySdkBenchmarksActivity
|
||||
{
|
||||
private readonly ActivitySource benchmarkSource = new("Benchmark");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
|
|||
|
||||
namespace Benchmarks.Trace
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class TraceBenchmarks
|
||||
{
|
||||
private readonly ActivitySource sourceWithNoListener = new("Benchmark.NoListener");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
|
|||
|
||||
namespace Benchmarks.Trace
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
public class TraceShimBenchmarks
|
||||
{
|
||||
private readonly Tracer tracerWithNoListener = TracerProvider.Default.GetTracer("Benchmark.NoListener");
|
||||
|
|
|
|||
Loading…
Reference in New Issue