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.
Afficher le fichier Open project: petabridge/NBench Class Usage Examples

Méthodes publiques

Méthode 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 méthode

public BenchmarkContext ( Counter>.IReadOnlyDictionary counters, IBenchmarkTrace trace ) : System
counters Counter>.IReadOnlyDictionary
trace IBenchmarkTrace
Résultat System

CounterExists() public méthode

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.
Résultat bool

GetCounter() public méthode

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.
Résultat Counter