Ejemplo n.º 1
0
    public static async Task Run()
    {
        countdownEvent = new CountdownEvent(iterations);
        var configuration = new EndpointConfiguration("DataBusPerfTests");

        configuration.ApplySharedPerfConfig();
        var fileShare = Path.GetFullPath("databus");

        Directory.CreateDirectory(fileShare);
        Helpers.PurgeDirectory(fileShare);
        var dataBus = configuration.UseDataBus <FileShareDataBus>();

        dataBus.BasePath(fileShare);
        var endpoint = await Endpoint.Start(configuration).ConfigureAwait(false);

        var stopwatch = Stopwatch.StartNew();

        await SendStartMessages(endpoint).ConfigureAwait(false);

        Console.WriteLine(stopwatch.Elapsed);
        countdownEvent.Wait();
        Console.WriteLine(stopwatch.Elapsed);
        await endpoint.Stop().ConfigureAwait(false);

        countdownEvent.Dispose();
    }
Ejemplo n.º 2
0
    public static async Task Run()
    {
        countdownEvent = new CountdownEvent(iterations);
        var configuration = new EndpointConfiguration("FileShareAttachmentPerfTests");

        configuration.ApplySharedPerfConfig();
        var fileShare = Path.GetFullPath("attachments");

        Directory.CreateDirectory(fileShare);
        Helpers.PurgeDirectory(fileShare);
        configuration.EnableAttachments(fileShare, TimeToKeep.Default);
        var endpoint = await Endpoint.Start(configuration).ConfigureAwait(false);

        var stopwatch = Stopwatch.StartNew();

        await SendStartMessages(endpoint).ConfigureAwait(false);

        Console.WriteLine(stopwatch.Elapsed);
        countdownEvent.Wait();
        Console.WriteLine(stopwatch.Elapsed);
        await endpoint.Stop().ConfigureAwait(false);

        countdownEvent.Dispose();
    }