Show / Hide Table of Contents

Class InProcessHost

Host API for in-process benchmarks.

Inheritance
Object
InProcessHost
Implements
IHost
Namespace: BenchmarkDotNet.Toolchains.InProcess
Assembly: BenchmarkDotNet.dll
Syntax
public sealed class InProcessHost : IHost

Constructors

InProcessHost(BenchmarkCase, ILogger, IDiagnoser)

Creates a new instance of InProcessHost.

Declaration
public InProcessHost(BenchmarkCase benchmarkCase, ILogger logger, IDiagnoser diagnoser)
Parameters
Type Name Description
BenchmarkCase benchmarkCase

Current benchmark.

ILogger logger

Logger for informational output.

IDiagnoser diagnoser

Diagnosers, if attached.

Properties

Config

Current config

Declaration
public IConfig Config { get; set; }
Property Value
Type Description
IConfig

IsDiagnoserAttached

True if there are diagnosers attached.

Declaration
public bool IsDiagnoserAttached { get; }
Property Value
Type Description
Boolean

True if there are diagnosers attached.

RunResults

Results of the run.

Declaration
public RunResults RunResults { get; }
Property Value
Type Description
RunResults

Results of the run.

Methods

ReportResults(RunResults)

Submits run results to the host.

Declaration
public void ReportResults(RunResults runResults)
Parameters
Type Name Description
RunResults runResults

The run results.

SendError(String)

Declaration
public void SendError(string message)
Parameters
Type Name Description
String message

SendSignal(HostSignal)

Sends notification signal to the host.

Declaration
public void SendSignal(HostSignal hostSignal)
Parameters
Type Name Description
HostSignal hostSignal

The signal to send.

Write(String)

Passes text to the host.

Declaration
public void Write(string message)
Parameters
Type Name Description
String message

Text to write.

WriteLine()

Passes new line to the host.

Declaration
public void WriteLine()

WriteLine(String)

Passes text (new line appended) to the host.

Declaration
public void WriteLine(string message)
Parameters
Type Name Description
String message

Text to write.

Implements

IHost

Extension Methods

HostExtensions.WriteLine(IHost, String, Object[])
HostExtensions.BeforeAnythingElse(IHost)
HostExtensions.BeforeMainRun(IHost)
HostExtensions.AfterMainRun(IHost)
HostExtensions.AfterAll(IHost)

See Also

IHost
In This Article
Back to top Copyright © 2013–2021 .NET Foundation and contributors