Control `MemoryDiagnoser` benchmark option via CLI instead of code (#3085)

This commit is contained in:
Michael Maxwell 2022-04-12 13:42:33 -07:00 committed by GitHub
parent 89a740e20a
commit c261a67005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 7 additions and 25 deletions

View File

@ -20,7 +20,6 @@ using OpenTelemetry.Internal;
namespace OpenTelemetry.Benchmarks
{
[MemoryDiagnoser]
public class EventSourceBenchmarks
{
[Benchmark]

View File

@ -27,7 +27,6 @@ using OpenTelemetry.Internal;
namespace Benchmarks.Exporter
{
[MemoryDiagnoser]
public class JaegerExporterBenchmarks
{
private Activity activity;

View File

@ -31,7 +31,6 @@ using OtlpCollector = OpenTelemetryProtocol::Opentelemetry.Proto.Collector.Trace
namespace Benchmarks.Exporter
{
[MemoryDiagnoser]
public class OtlpGrpcExporterBenchmarks
{
private OtlpTraceExporter exporter;

View File

@ -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];

View File

@ -26,7 +26,6 @@ using Prometheus::OpenTelemetry.Exporter.Prometheus;
namespace Benchmarks.Exporter
{
[MemoryDiagnoser]
public class PrometheusSerializerBenchmarks
{
private readonly List<Metric> metrics = new();

View File

@ -28,7 +28,6 @@ using Zipkin::OpenTelemetry.Exporter;
namespace Benchmarks.Exporter
{
[MemoryDiagnoser]
#if !NET462
[ThreadingDiagnoser]
#endif

View File

@ -23,7 +23,6 @@ using OpenTelemetry.Instrumentation;
namespace Benchmarks.Instrumentation
{
[InProcess]
[MemoryDiagnoser]
public class DiagnosticSourceSubscriberBenchmark
{
[Params(1, 2)]

View File

@ -23,7 +23,6 @@ using Benchmarks.Helper;
namespace Benchmarks.Instrumentation
{
[InProcess]
[MemoryDiagnoser]
public class InstrumentedAspNetCoreBenchmark
{
private const string LocalhostUrl = "http://localhost:5050";

View File

@ -26,7 +26,6 @@ using OpenTelemetry.Trace;
namespace Benchmarks.Instrumentation
{
[MemoryDiagnoser]
public class InstrumentedHttpClientBenchmark
{
private const string ActivityName = "incoming request";

View File

@ -23,7 +23,6 @@ using Benchmarks.Helper;
namespace Benchmarks.Instrumentation
{
[InProcess]
[MemoryDiagnoser]
public class UninstrumentedAspNetCoreBenchmark
{
private const string LocalhostUrl = "http://localhost:5050";

View File

@ -22,7 +22,6 @@ using OpenTelemetry.Tests;
namespace Benchmarks.Instrumentation
{
[MemoryDiagnoser]
public class UninstrumentedHttpClientBenchmark
{
private IDisposable serverLifeTime;

View File

@ -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;

View File

@ -23,7 +23,6 @@ using OpenTelemetry.Logs;
namespace Benchmarks.Logs
{
[MemoryDiagnoser]
public class LogScopeBenchmarks
{
private readonly LoggerExternalScopeProvider scopeProvider = new();

View File

@ -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;

View File

@ -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" };

View File

@ -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();

View File

@ -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());

View File

@ -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*`

View File

@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
namespace Benchmarks.Trace
{
[MemoryDiagnoser]
public class OpenTelemetrySdkBenchmarks
{
private Tracer alwaysSampleTracer;

View File

@ -22,7 +22,6 @@ using OpenTelemetry.Trace;
namespace Benchmarks.Trace
{
[MemoryDiagnoser]
public class OpenTelemetrySdkBenchmarksActivity
{
private readonly ActivitySource benchmarkSource = new("Benchmark");

View File

@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
namespace Benchmarks.Trace
{
[MemoryDiagnoser]
public class TraceBenchmarks
{
private readonly ActivitySource sourceWithNoListener = new("Benchmark.NoListener");

View File

@ -21,7 +21,6 @@ using OpenTelemetry.Trace;
namespace Benchmarks.Trace
{
[MemoryDiagnoser]
public class TraceShimBenchmarks
{
private readonly Tracer tracerWithNoListener = TracerProvider.Default.GetTracer("Benchmark.NoListener");