BenchmarkDotNet exporter for Datadog CI Visibility
$ dotnet add package Datadog.Trace.BenchmarkDotNetThis package contains the BenchmarkDotNet exporter and instrumentation for Datadog CI Visibility.
BenchmarkDotNet 0.13.2 and aboveDatadog.Trace.BenchmarkDotNet NuGet package to your project, using dotnet add package Datadog.Trace.BenchmarkDotNet, for example.There's two way to configure a benchmark project to use the Datadog's exporter:
Add the DatadogDiagnoser attribute to the benchmark class.
using BenchmarkDotNet.Attributes;
using Datadog.Trace.BenchmarkDotNet;
[DatadogDiagnoser]
[MemoryDiagnoser]
public class OperationBenchmark
{
[Benchmark]
public void Operation()
{
// ...
}
}
Use the WithDatadog() extension method on the current project configuration:
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
using Datadog.Trace.BenchmarkDotNet;
var config = DefaultConfig.Instance
.WithDatadog();
BenchmarkRunner.Run<OperationBenchmark>(config);
If you have questions, feedback, or feature requests, reach our support.