Skip to content

Commit c3ef37c

Browse files
authored
Check for Empty ASP.NET Benchmark Filters + Documentation (#3870)
* Check for Empty Filters * Fixed up documentation * Removed trailing spaces to fix md linting
1 parent 952993a commit c3ef37c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure/Commands/ASPNetBenchmarks/AspNetBenchmarksCommand.cs

+5
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ public static AspNetBenchmarkResults RunASPNetBenchmarks(ASPNetBenchmarksConfigu
258258
}
259259
}
260260
}
261+
262+
if (benchmarkToNameCommandAsKvpList.Count == 0)
263+
{
264+
throw new ArgumentException($"{nameof(AspNetBenchmarksCommand)}: No benchmark filters found. Please ensure you have added the wildcard character to do the regex matching. Benchmark Filter: {configuration.benchmark_settings.benchmarkFilters}");
265+
}
261266
}
262267

263268
// Else, add all the benchmarks.

src/benchmarks/gc/GC.Infrastructure/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,19 @@ It's worth noting that if you have specified Linux based binaries in the corerun
209209
1. Remove the ``crank`` prefix from the command line.
210210
2. Remove the ``--application.aspNetCoreVersion``, ``--application.runtimeVersion`` and ``--application.sdkVersion`` command args from the command line that you paste in the CSV as the versions are set by the infrastructure itself.
211211

212+
###### How To Filter Benchmarks
213+
214+
You can filter benchmarks of interest from the entire set of benchmarks specified by the referenced `benchmarks_file` using a list of regex patterns such as the following in the `benchmark_settings` section:
215+
216+
```yaml
217+
benchmark_settings:
218+
benchmark_filters:
219+
- Stage1Aot_Windows*
220+
- PlainText*
221+
```
222+
223+
If there is a match, these filters will run in the order specified in the yaml file.
224+
212225
## All Commands
213226

214227
The infrastructure can be run in modular manner. What this means is that you can invoke a particular command that runs some part of the infrastructure. A list of all the commands can be found here:

0 commit comments

Comments
 (0)