NBench 0.1.0

NBench is a cross-platform automated performance profiling and testing framework for.NET applications.

There is a newer version of this package available.
See the version list below for details.
Install-Package NBench -Version 0.1.0
dotnet add package NBench --version 0.1.0
<PackageReference Include="NBench" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NBench --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

First "production-ready" release of NBench.
Please see our detailed [NBench README and FAQ](https://github.com/petabridge/nbench) for instructions and documentation!
To use NBench, install the NBench package from NuGet:
```
PS> Install-Package NBench
```
And then create a POCO class with a default constructor and some methods, like this:
```csharp
using NBench.Util;
using NBench;
/// <summary>
/// Test to see if we can achieve max throughput on a <see cref="AtomicCounter"/>
/// </summary>
public class CounterPerfSpecs
{
private Counter _counter;
[PerfSetup]
public void Setup(BenchmarkContext context)
{
_counter = context.GetCounter("TestCounter");
}
[PerfBenchmark(Description = "Test to ensure that a minimal throughput test can be rapidly executed.",
NumberOfIterations = 3, RunMode = RunMode.Throughput,
RunTimeMilliseconds = 1000, TestMode = TestMode.Test)]
[CounterThroughputAssertion("TestCounter", MustBe.GreaterThan, 10000000.0d)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThanOrEqualTo, ByteConstants.ThirtyTwoKb)]
[GcTotalAssertion(GcMetric.TotalCollections, GcGeneration.Gen2, MustBe.ExactlyEqualTo, 0.0d)]
public void Benchmark()
{
_counter.Increment();
}
[PerfCleanup]
public void Cleanup(){
// does nothing
}
}
```
After defining some NBench `PerfBenchmark` methods and declaring some measurements, you can run your benchmark by downloading the `NBench.Runner.exe` via NuGet.
```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\NBench.Runner.exe .\src\bin\Debug\MyPerfTests.dll output-directory="C:\Perf"
```
And this command will run your `PerfBenchmark` and write output [that looks like this](https://gist.github.com/Aaronontheweb/8e0bfa2cccc63f5bd8bf) to a markdown file in the `output-directory`.

Dependencies

This package has no dependencies.

Showing the top 5 GitHub repositories that depend on NBench:

Repository Stars
akkadotnet/akka.net
Port of Akka actors for .NET
Azure/DotNetty
DotNetty project – a port of netty, event-driven asynchronous network application framework
RicoSuter/NJsonSchema
JSON Schema reader, generator and validator for .NET
helios-io/helios
reactive socket middleware for .NET
SonarSource/sonar-dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html

Version History

Version Downloads Last updated
1.2.2 24,153 7/24/2018
1.2.1 820 7/11/2018
1.2.0 322 7/10/2018
1.1.0 1,312 7/2/2018
1.0.4 59,190 6/16/2017
1.0.3 537 6/11/2017
1.0.2 501 6/2/2017
1.0.1 14,820 3/31/2017
1.0.0 3,114 3/15/2017
0.3.4 24,230 12/16/2016
0.3.3 697 12/8/2016
0.3.2 427 12/8/2016
0.3.1 9,854 8/16/2016
0.3.0 6,349 5/24/2016
0.2.2 1,567 5/3/2016
0.2.1 1,624 4/7/2016
0.2.0 392 4/6/2016
0.1.6 896 2/15/2016
0.1.5 5,255 12/10/2015
0.1.4 429 12/10/2015
0.1.3 447 12/8/2015
0.1.2 404 12/8/2015
0.1.1 412 12/7/2015
0.1.0 427 12/4/2015
0.0.2 439 12/4/2015
Show less