public Sdk_ReflectionBenchmarkInvokerWithRealWork() { var benchmarkType = typeof(AtomicCounterBenchmark); var benchmarks = CreateBenchmarksForClass(benchmarkType); _contextInvoker = CreateInvokerForBenchmark(benchmarks.Single()); _contextInvoker.InvokePerfSetup(BenchmarkContext.Empty); }
public Benchmark(BenchmarkSettings settings, IBenchmarkInvoker invoker, IBenchmarkOutput writer) { Settings = settings; _pendingIterations = Settings.NumberOfIterations; Invoker = invoker; Output = writer; CompletedRuns = new Queue <BenchmarkRunReport>(Settings.NumberOfIterations); Builder = new BenchmarkBuilder(Settings); }
public Benchmark(BenchmarkSettings settings, IBenchmarkInvoker invoker, IBenchmarkOutput writer) { Settings = settings; _pendingIterations = Settings.NumberOfIterations; Invoker = invoker; Output = writer; CompletedRuns = new Queue<BenchmarkRunReport>(Settings.NumberOfIterations); Builder = new BenchmarkBuilder(Settings); }
public Sdk_ReflectionBenchmarkInvoker() { var benchmarkType = typeof (BenchmarkWithContext); var benchmarks = CreateBenchmarksForClass(benchmarkType); _contextInvoker = CreateInvokerForBenchmark(benchmarks.Single()); _contextInvoker.InvokePerfSetup(BenchmarkContext.Empty); benchmarkType = typeof(BenchmarkWithoutContext); benchmarks = CreateBenchmarksForClass(benchmarkType); _withoutContextInvoker = CreateInvokerForBenchmark(benchmarks.Single()); _withoutContextInvoker.InvokePerfSetup(BenchmarkContext.Empty); }
public Sdk_ReflectionBenchmarkInvoker() { var benchmarkType = typeof(BenchmarkWithContext); var benchmarks = CreateBenchmarksForClass(benchmarkType); _contextInvoker = CreateInvokerForBenchmark(benchmarks.Single()); _contextInvoker.InvokePerfSetup(BenchmarkContext.Empty); benchmarkType = typeof(BenchmarkWithoutContext); benchmarks = CreateBenchmarksForClass(benchmarkType); _withoutContextInvoker = CreateInvokerForBenchmark(benchmarks.Single()); _withoutContextInvoker.InvokePerfSetup(BenchmarkContext.Empty); }
/// <summary> /// Backwards-compatible constructor for NBench 0.1.6 and earlier. /// </summary> /// <param name="settings">The settings for this benchmark.</param> /// <param name="invoker">The invoker used to execute benchmark and setup / cleanup methods.</param> /// <param name="writer">The output target this benchmark will write to.</param> /// <remarks>Uses the <see cref="DefaultBenchmarkAssertionRunner"/> to assert benchmark data.</remarks> public Benchmark(BenchmarkSettings settings, IBenchmarkInvoker invoker, IBenchmarkOutput writer) : this(settings, invoker, writer, DefaultBenchmarkAssertionRunner.Instance) { }