Table of Contents

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

options BenchmarkWorkspaceOptions

The BenchmarkWorkspaceOptions which configures repository paths, build modes and BenchmarkDotNet configuration.

Exceptions

ArgumentNullException

options cannot be null.

ArgumentException

options are not in a valid state.

Methods

LoadBenchmarkAssemblies()

Loads benchmark assemblies discovered recursively in the tuning folder.

public Assembly[] LoadBenchmarkAssemblies()

Returns

Assembly[]

An array of Assembly instances representing the loaded benchmark assemblies.

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.