Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions tracer/build/_build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,32 @@ void DeleteReparsePoints(string path)
.Description("Runs the Benchmarks project")
.Executes(() =>
{
var benchmarkProjectsWithSettings = new Tuple<string, Func<DotNetRunSettings, DotNetRunSettings>>[] {
new(Projects.BenchmarksTrace, s => s),
var benchmarkProjectsWithSettings = new List<(string Project, Func<DotNetRunSettings, DotNetRunSettings> Configure)>
{
(Projects.BenchmarksTrace, s => s),
// new(Projects.BenchmarksOpenTelemetryApi, s => s),
new(Projects.BenchmarksOpenTelemetryInstrumentedApi,
(Projects.BenchmarksOpenTelemetryInstrumentedApi,
s => s.SetProcessEnvironmentVariable("DD_TRACE_OTEL_ENABLED", "true")
.SetProcessEnvironmentVariable("DD_INSTRUMENTATION_TELEMETRY_ENABLED", "false")
.SetProcessEnvironmentVariable("DD_INTERNAL_AGENT_STANDALONE_MODE_ENABLED", "true")
.SetProcessEnvironmentVariable("DD_CIVISIBILITY_FORCE_AGENT_EVP_PROXY", "V4")),
};

var isPr = int.TryParse(Environment.GetEnvironmentVariable("PR_NUMBER"), out var _);
// We don't run the base Otel benchmarks on PRs as nothing we do should change them.
// We _do_ run them on master, so we have up-to-date comparison data
// We can't easily use the benchmark "category" approach that we use below, because the BenchmarksOpenTelemetryApi
// project shares the same tests as BenchmarksOpenTelemetryInstrumentedApi.
if (!isPr)
{
benchmarkProjectsWithSettings.Add((Projects.BenchmarksOpenTelemetryApi, s => s));
}


foreach (var tuple in benchmarkProjectsWithSettings)
{
var benchmarkProjectName = tuple.Item1;
var configureDotNetRunSettings = tuple.Item2;
var benchmarkProjectName = tuple.Project;
var configureDotNetRunSettings = tuple.Configure;

var benchmarksProject = Solution.GetProject(benchmarkProjectName);
var resultsDirectory = benchmarksProject.Directory / "BenchmarkDotNet.Artifacts" / "results";
Expand All @@ -608,7 +620,6 @@ void DeleteReparsePoints(string path)
};

// We could choose to not run asm on non-ASM PRs (for example) but for now we just run all categories
var isPr = int.TryParse(Environment.GetEnvironmentVariable("PR_NUMBER"), out var _);
var categories = (BenchmarkCategory, isPr) switch
{
({ Length: > 0 }, _) => BenchmarkCategory,
Expand Down
Loading