Namespace NBench
Classes
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.
ByteConstants
Handy class for being able to use pre-calculated constant values for computing byte sizes
Counter
A high-performance, thread-safe counter class used to measure throughput on user-defined metrics
CounterMeasurementAttribute
Creates a custom Counter to be used for tracking app-specific metrics in combination with a PerfBenchmarkAttribute
CounterThroughputAssertionAttribute
Performs an assertion against counters collected over the course of a benchmark.
This asserts the NUMBER OF OPERATIONS / SECOND values averaged over all runs of a benchmark.
CounterTotalAssertionAttribute
Performs an assertion against counters collected over the course of a benchmark.
This asserts the TOTAL AVERAGE NUMBER OF OPERATIONS values averaged over all runs of a benchmark.
ElapsedTimeAssertionAttribute
Takes data from a TimingMeasurementAttribute and performs an assertion on it basedon MaxTimeMilliseconds and MinTimeMilliseconds (the latter is optional.)
GcMeasurementAttribute
Issues a command to NBench to monitor system GC metrics that occur during the PerfBenchmarkAttribute.
GcThroughputAssertionAttribute
Performs an assertion against counters collected over the course of a benchmark.
This asserts the NUMBER OF OPERATIONS / SECOND values averaged over all runs of a benchmark.
GcTotalAssertionAttribute
Performs an assertion against counters collected over the course of a benchmark.
This asserts the TOTAL AVERAGE NUMBER OF OPERATIONS values averaged over all runs of a benchmark.
MeasurementAttribute
Abstract base class used by all Measurements in NBench
MemoryAssertionAttribute
Performs an assertion against memory counters collected over the course of a benchmark.
MemoryMeasurementAttribute
Issues a command to NBench to monitor various memory metrics allocated during the PerfBenchmarkAttribute
NBenchCommands
Command line argument parser for NBench specifications
Parses arguments from System.Environment.GetCommandLineArgs.
For example (from the Akka.NodeTestRunner source):
var outputDirectory = CommandLine.GetInt32("output-directory");
NBenchException
Exceptions thrown by NBench
NBenchRunner
PerfBenchmarkAttribute
Marks a method on a class as being an NBench performance test
PerfCleanupAttribute
Performs a cleanup operation after the PerfBenchmarkAttribute gets run.
PerfSetupAttribute
Performs a setup operation before the PerfBenchmarkAttribute gets run.
TimingMeasurementAttribute
Used to measure and assert how much time elapses while executing a block of code.
Typically designed for work with Iterations benchmarks that are longer-running (can be measured in whole milliseconds.)
Interfaces
IBenchmarkTrace
Exposed to the end-user by BenchmarkContext so they can add diagnostic messages to the output of a benchmark.
Enums
GcGeneration
Specifies the CLR Garbage Collection generation to track during a PerfBenchmarkAttribute
GcMetric
Specifies the CLR garbage collection metric we want to track, usually in combination with a GcGeneration.
MemoryMetric
Available memory-related metrics that can be profiled and tested against
MustBe
Comparison and test types used by NBench for performing performance test BenchmarkAssertions
RunMode
TestMode
Specifies the way we want to run a particular performance test