diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/BenchmarkServer.csproj b/src/SignalR/perf/benchmarkapps/BenchmarkServer/BenchmarkServer.csproj deleted file mode 100644 index 4bcf55a1a2..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/BenchmarkServer.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.props b/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.props deleted file mode 100644 index 8c119d5413..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.props +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.targets b/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.targets deleted file mode 100644 index 2e3fb2fa71..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Hubs/EchoHub.cs b/src/SignalR/perf/benchmarkapps/BenchmarkServer/Hubs/EchoHub.cs deleted file mode 100644 index f6336fab84..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Hubs/EchoHub.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.SignalR; - -namespace BenchmarkServer.Hubs -{ - public class EchoHub : Hub - { - public async Task Broadcast(int duration) - { - var sent = 0; - try - { - var t = new CancellationTokenSource(); - t.CancelAfter(TimeSpan.FromSeconds(duration)); - while (!t.IsCancellationRequested && !Context.ConnectionAborted.IsCancellationRequested) - { - await Clients.All.SendAsync("send", DateTime.UtcNow); - sent++; - } - } - catch (Exception e) - { - Console.WriteLine(e); - } - Console.WriteLine("Broadcast exited: Sent {0} messages", sent); - } - - public DateTime Echo(DateTime time) - { - return time; - } - - public Task EchoAll(DateTime time) - { - return Clients.All.SendAsync("send", time); - } - - public void SendPayload(string payload) - { - // Dump the payload, we don't care - } - - public DateTime GetCurrentTime() - { - return DateTime.UtcNow; - } - } -} diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Program.cs b/src/SignalR/perf/benchmarkapps/BenchmarkServer/Program.cs deleted file mode 100644 index 0232643b58..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Program.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Diagnostics; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace BenchmarkServer -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}"); - - var config = new ConfigurationBuilder() - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .AddCommandLine(args) - .Build(); - - var host = new WebHostBuilder() - .UseConfiguration(config) - .ConfigureLogging(loggerFactory => - { - if (Enum.TryParse(config["LogLevel"], out LogLevel logLevel)) - { - loggerFactory.AddConsole().SetMinimumLevel(logLevel); - } - }) - .UseKestrel() - .UseStartup(); - - host.Build().Run(); - } - } -} diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/README.md b/src/SignalR/perf/benchmarkapps/BenchmarkServer/README.md deleted file mode 100644 index e4f8ceb7a3..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/README.md +++ /dev/null @@ -1,17 +0,0 @@ -## Purpose - -This project is to assist in Benchmarking SignalR. -It makes it easier to test local changes than having the App in the Benchmarks repo by letting us make changes in signalr branches and using the example commandline below to run the benchmarks against our branches. - -The SignalRWorker that runs against this server is located at https://github.com/aspnet/benchmarks/blob/master/src/BenchmarksClient/Workers/SignalRWorker.cs. - -## Usage - -1. Push changes you would like to test to a branch on GitHub -2. Clone aspnet/benchmarks repo to your machine or install the global BenchmarksDriver tool https://www.nuget.org/packages/BenchmarksDriver/ -3. If cloned go to the BenchmarksDriver project -4. Use the following command as a guideline for running a test using your changes - -`benchmarks --server --client -p TransportType=WebSockets -p HubProtocol=messagepack -j https://raw.githubusercontent.com/aspnet/SignalR/dev/benchmarks/BenchmarkServer/signalr.json` - -5. For more info/commands see https://github.com/aspnet/benchmarks/blob/master/src/BenchmarksDriver/README.md diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Startup.cs b/src/SignalR/perf/benchmarkapps/BenchmarkServer/Startup.cs deleted file mode 100644 index 139ec09d47..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/Startup.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using BenchmarkServer.Hubs; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace BenchmarkServer -{ - public class Startup - { - private readonly IConfiguration _config; - public Startup(IConfiguration configuration) - { - _config = configuration; - } - - public void ConfigureServices(IServiceCollection services) - { - var signalrBuilder = services.AddSignalR(o => - { - o.EnableDetailedErrors = true; - }) - // TODO: Json vs NewtonsoftJson option - .AddMessagePackProtocol(); - - var redisConnectionString = _config["SignalRRedis"]; - if (!string.IsNullOrEmpty(redisConnectionString)) - { - signalrBuilder.AddStackExchangeRedis(redisConnectionString); - } - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - app.UseSignalR(routes => - { - routes.MapHub("/echo", o => - { - // Remove backpressure for benchmarking - o.TransportMaxBufferSize = 0; - o.ApplicationMaxBufferSize = 0; - }); - }); - } - } -} diff --git a/src/SignalR/perf/benchmarkapps/BenchmarkServer/signalr.json b/src/SignalR/perf/benchmarkapps/BenchmarkServer/signalr.json deleted file mode 100644 index 9fc37041b3..0000000000 --- a/src/SignalR/perf/benchmarkapps/BenchmarkServer/signalr.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Default": { - "Client": "SignalR", - "Source": { - "Repository": "https://github.com/aspnet/aspnetcore.git", - "BranchOrCommit": "master", - "Project": "src/SignalR/perf/benchmarkapps/BenchmarkServer/BenchmarkServer.csproj" - }, - "Connections": 10, - "Duration": 20, - "Warmup": 2, - "Path": "/echo", - "ClientProperties": { - "CollectLatency": "true" - } - }, - "SignalRBroadcast": { - "ClientProperties": { "Scenario": "broadcast" } - }, - "SignalREcho": { - "ClientProperties": { "Scenario": "echo" } - }, - "SignalREchoAll": { - "ClientProperties": { "Scenario": "echoAll" }, - "Warmup": 0 - }, - "SignalREchoIdle": { - "ClientProperties": { - "Scenario": "echoIdle", - "CollectLatency": "false" - } - } -} diff --git a/src/SignalR/perf/benchmarkapps/NuGet.Config b/src/SignalR/perf/benchmarkapps/NuGet.Config deleted file mode 100644 index 298193b812..0000000000 --- a/src/SignalR/perf/benchmarkapps/NuGet.Config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - -