NBench.PerformanceCounters 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NBench.PerformanceCounters --version 0.3.0
                    
NuGet\Install-Package NBench.PerformanceCounters -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NBench.PerformanceCounters" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NBench.PerformanceCounters" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="NBench.PerformanceCounters" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NBench.PerformanceCounters --version 0.3.0
                    
#r "nuget: NBench.PerformanceCounters, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NBench.PerformanceCounters@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NBench.PerformanceCounters&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=NBench.PerformanceCounters&version=0.3.0
                    
Install as a Cake Tool

PerformanceCounter measurements and assertions for NBench

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.2 8,116 7/24/2018
1.2.1 2,262 7/11/2018
1.2.0 1,533 7/10/2018
1.1.0 1,274 7/2/2018
1.0.4 2,328 6/16/2017
1.0.3 1,367 6/11/2017
1.0.2 1,351 6/2/2017
1.0.1 1,391 3/31/2017
1.0.0 1,441 3/15/2017
0.3.4 21,335 12/16/2016
0.3.3 1,682 12/8/2016
0.3.2 1,419 12/8/2016
0.3.1 1,581 8/16/2016
0.3.0 4,044 5/24/2016
0.2.2 1,436 5/3/2016
0.2.1 2,046 4/7/2016
0.2.0 1,422 4/6/2016

This release introduces some breaking changes to NBench:
Tracing**
The biggest feature included in this release is the addition of tracing support, which is exposed directly to end-users so they can capture trace events and include them in the output produced by NBench.
You can access the `IBenchmarkTrace` object through the `BenchmarkContext` passed into any of your `PerfSetup`, `PerfBenchmark`, or `PerfCleanup` methods like such:
```csharp
public class TracingBenchmark
{
[PerfSetup]
public void Setup(BenchmarkContext context)
{
context.Trace.Debug(SetupTrace);
}
[PerfBenchmark(TestMode = TestMode.Test, NumberOfIterations = IterationCount, RunTimeMilliseconds = 1000)]
[MemoryMeasurement(MemoryMetric.TotalBytesAllocated)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThan, ByteConstants.EightKb)]
public void Run1(BenchmarkContext context)
{
context.Trace.Debug(RunTrace);
}
[PerfCleanup]
public void Cleanup(BenchmarkContext context)
{
context.Trace.Info(CleanupTrace);
}
}
```
`NBench.Runner.exe` now takes a `trace=true|false` commandline argument, which will enable the new tracing feature introduced in this release.
Tracing is disabled by default**.
Skippable Warmups**
You can now elect to skip warmups altogether for your specs. This feature is particularly useful for long-running iteration benchmarks, which are often used for stress tests. Warmups don't add any value here.
Here's how you can skip warmups:
```csharp
[PerfBenchmark(TestMode = TestMode.Test, NumberOfIterations = IterationCount, RunTimeMilliseconds = 1000, SkipWarmups = true)]
[MemoryMeasurement(MemoryMetric.TotalBytesAllocated)]
[MemoryAssertion(MemoryMetric.TotalBytesAllocated, MustBe.LessThan, ByteConstants.EightKb)]
public void Run1(BenchmarkContext context)
{
context.Trace.Debug(RunTrace);
}
```
Just set `SkipWarmups = true` on your `PerfBenchmark` attribute wherever you wish to skip a warmup.
Foreground thread is no longer given high priority when concurrent mode is on**.
If you are running the `NBench.Runner` with `concurrent=true`, we no longer give the main foreground thread high priority as this resulted in some unfair scheduling during concurrent tests. All threads within the `NBench.Runner` process all share the same priority now.
Markdown reports include additional data**
All markdown reports now include:
The concurrency setting for NBench
The tracing setting for NBench
A flag indicating if warmups were skipped or not
All of these were added in order to make it easy for end-users reading the reports to know what the NBench settings were at the time the report was produced.