petabridge / NBench

Performance benchmarking and testing framework for .NET applications :chart_with_upwards_trend:
https://nbench.io/
Apache License 2.0
532 stars 46 forks source link

PerfBenchmark with TestMode.Measurement throws error without assertion #475

Open DR9885 opened 5 months ago

DR9885 commented 5 months ago

PerfBenchmark with TestMode.Measurement throws error without assertion. Isn't testmode measurment meant to be use with no assertions. Is there any way we can disable this check?

Example:

    public class TempBenchmark
    {
        private Counter _counter;

        [PerfSetup]
        public void Setup(BenchmarkContext context)
        {
            _counter = context.GetCounter("Event");
        }

        [PerfBenchmark(RunMode = RunMode.Iterations, TestMode = TestMode.Measurement)]
        // [CounterThroughputAssertion("Event", MustBe.GreaterThan, 0.20d)]
        public void Iterations()
        {
            _counter.Increment();
        }
    }