Remove unused SignalR benchmarks app (#12954)
This commit is contained in:
parent
8dd3cd4129
commit
ecd6c11c46
|
|
@ -1,30 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- These references are used when running locally -->
|
||||
<ItemGroup Condition="'$(BenchmarksTargetFramework)' == ''">
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR" />
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" />
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" />
|
||||
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
|
||||
<Reference Include="Microsoft.Extensions.Configuration.CommandLine" />
|
||||
<Reference Include="Microsoft.Extensions.Logging.Console" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- These references are used when running on the Benchmarks Server -->
|
||||
<ItemGroup Condition="'$(BenchmarksTargetFramework)' != ''">
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
|
||||
<FrameworkReference Update="Microsoft.AspNetCore.App" RuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppPackageVersion)" />
|
||||
<FrameworkReference Update="Microsoft.NETCore.App" RuntimeFrameworkVersion="$(MicrosoftNETCoreAppPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<Project>
|
||||
</Project>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<!-- This file prevents any other Directory.Build.targets from a parent folder to be loaded -->
|
||||
<Project>
|
||||
</Project>
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Startup>();
|
||||
|
||||
host.Build().Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <server-endpoint> --client <client-endpoint> -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
|
||||
|
|
@ -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<EchoHub>("/echo", o =>
|
||||
{
|
||||
// Remove backpressure for benchmarking
|
||||
o.TransportMaxBufferSize = 0;
|
||||
o.ApplicationMaxBufferSize = 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
|
||||
<add key="extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
|
||||
<add key="entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
|
||||
<add key="aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
|
||||
<add key="aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
|
||||
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
Loading…
Reference in New Issue