Class InProcessHost
- Namespace
- BenchmarkDotNet.Toolchains.InProcess
- Assembly
- BenchmarkDotNet.dll
Host API for in-process benchmarks.
public sealed class InProcessHost : IHost, IDisposable
- Inheritance
-
InProcessHost
- Implements
- Extension Methods
Constructors
InProcessHost(BenchmarkCase, ILogger, IDiagnoser)
Creates a new instance of InProcessHost.
public InProcessHost(BenchmarkCase benchmarkCase, ILogger logger, IDiagnoser diagnoser)
Parameters
benchmarkCaseBenchmarkCaseCurrent benchmark.
loggerILoggerLogger for informational output.
diagnoserIDiagnoserDiagnosers, if attached.
Properties
Config
Current config
public IConfig Config { get; set; }
Property Value
IsDiagnoserAttached
True if there are diagnosers attached.
public bool IsDiagnoserAttached { get; }
Property Value
- bool
Trueif there are diagnosers attached.
RunResults
Results of the run.
public RunResults RunResults { get; }
Property Value
- RunResults
Results of the run.
Methods
Dispose()
public void Dispose()
ReportResults(RunResults)
Submits run results to the host.
public void ReportResults(RunResults runResults)
Parameters
runResultsRunResultsThe run results.
SendError(string)
public void SendError(string message)
Parameters
messagestring
SendSignal(HostSignal)
Sends notification signal to the host.
public void SendSignal(HostSignal hostSignal)
Parameters
hostSignalHostSignalThe signal to send.
Write(string)
Passes text to the host.
public void Write(string message)
Parameters
messagestringText to write.
WriteLine()
Passes new line to the host.
public void WriteLine()
WriteLine(string)
Passes text (new line appended) to the host.
public void WriteLine(string message)
Parameters
messagestringText to write.