C# Class NBench.BenchmarkContext

Contains the runtime context for a given benchmark run. Makes it possible for developers to access built-in Counters declared via the CounterMeasurementAttribute, CounterThroughputAssertionAttribute, and CounterTotalAssertionAttribute classes.
ファイルを表示 Open project: petabridge/NBench Class Usage Examples

Public Methods

Method Description
BenchmarkContext ( Counter>.IReadOnlyDictionary counters, IBenchmarkTrace trace ) : System
CounterExists ( string name ) : bool

Determines if a counter with a particular name has been registered or not.

GetCounter ( string name ) : Counter

Retrieves a named Counter instance that has already been registered via a CounterMeasurementAttribute, CounterThroughputAssertionAttribute, or CounterTotalAssertionAttribute classes.

Method Details

BenchmarkContext() public method

public BenchmarkContext ( Counter>.IReadOnlyDictionary counters, IBenchmarkTrace trace ) : System
counters Counter>.IReadOnlyDictionary
trace IBenchmarkTrace
return System

CounterExists() public method

Determines if a counter with a particular name has been registered or not.
public CounterExists ( string name ) : bool
name string The name of the counter.
return bool

GetCounter() public method

Retrieves a named Counter instance that has already been registered via a CounterMeasurementAttribute, CounterThroughputAssertionAttribute, or CounterTotalAssertionAttribute classes.
public GetCounter ( string name ) : Counter
name string The name of the counter.
return Counter