C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

BenchmarkContext() публичный Метод

public BenchmarkContext ( Counter>.IReadOnlyDictionary counters, IBenchmarkTrace trace ) : System
counters Counter>.IReadOnlyDictionary
trace IBenchmarkTrace
Результат System

CounterExists() публичный Метод

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.
Результат bool

GetCounter() публичный Метод

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.
Результат Counter