Class BenchmarkWorkspace
- Namespace
- Codebelt.Extensions.BenchmarkDotNet
- Assembly
- Codebelt.Extensions.BenchmarkDotNet.dll
Provides a default implementation of IBenchmarkWorkspace for discovering and handling assemblies and their generated artifacts in BenchmarkDotNet.
public sealed class BenchmarkWorkspace : IBenchmarkWorkspace
- Inheritance
-
BenchmarkWorkspace
- Implements
Constructors
BenchmarkWorkspace(BenchmarkWorkspaceOptions)
Initializes a new instance of the BenchmarkWorkspace class with the specified options.
public BenchmarkWorkspace(BenchmarkWorkspaceOptions options)
Parameters
optionsBenchmarkWorkspaceOptionsThe BenchmarkWorkspaceOptions which configures repository paths, build modes and BenchmarkDotNet configuration.
Exceptions
- ArgumentNullException
optionscannot be null.- ArgumentException
optionsare not in a valid state.
Methods
LoadBenchmarkAssemblies()
Loads benchmark assemblies discovered recursively in the tuning folder.
public Assembly[] LoadBenchmarkAssemblies()
Returns
Remarks
Assemblies are selected by matching the configured BenchmarkProjectSuffix, the build configuration (Debug/Release based on AllowDebugBuild), and the target framework moniker (TargetFrameworkMoniker).
Exceptions
- InvalidOperationException
Thrown when no matching assemblies could be loaded from the tuning folder. Ensure the tuning folder contains built benchmark assemblies for the configured build configuration and TFM.
PostProcessArtifacts()
Performs post-processing of artifacts produced by BenchmarkDotNet.
public void PostProcessArtifacts()
Remarks
This method moves files found in the BenchmarkDotNet artifacts "results" directory into the tuning folder under the configured artifacts path and then deletes the now-empty "results" directory.