INNER CODE UNIT · C#

Benchmark

BEagle1984/silverback · benchmarks/LatestVersionBenchmarks/Benchmark.cs:14

public abstract class Benchmark
{
    private IHost? _host;

    protected IPublisher Publisher { get => field ?? throw new InvalidOperationException("The publisher is not initialized yet."); private set; }

    protected IHost Host => _host ?? throw new InvalidOperationException("Not yet initialized.");

    [GlobalSetup]
    public virtual void Setup()
    {
        _host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
            .ConfigureServices(
                services =>
                {
                    services.AddLogging(configure => configure.SetMinimumLevel(LogLevel.Error));
                    ConfigureServices(services);
                    ConfigureSilverback(services.AddSilverback());

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…