Add Redis support to E2E benchmarks (#2418)
This commit is contained in:
parent
8df8445cff
commit
948ebf34ec
|
|
@ -14,6 +14,7 @@
|
||||||
<ItemGroup Condition="'$(BenchmarksTargetFramework)' == ''">
|
<ItemGroup Condition="'$(BenchmarksTargetFramework)' == ''">
|
||||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SignalR\Microsoft.AspNetCore.SignalR.csproj" />
|
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SignalR\Microsoft.AspNetCore.SignalR.csproj" />
|
||||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SignalR.Protocols.MessagePack\Microsoft.AspNetCore.SignalR.Protocols.MessagePack.csproj" />
|
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SignalR.Protocols.MessagePack\Microsoft.AspNetCore.SignalR.Protocols.MessagePack.csproj" />
|
||||||
|
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SignalR.Redis\Microsoft.AspNetCore.SignalR.Redis.csproj" />
|
||||||
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(MicrosoftAspNetCoreServerKestrelPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(MicrosoftAspNetCoreServerKestrelPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(MicrosoftExtensionsConfigurationCommandLinePackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(MicrosoftExtensionsConfigurationCommandLinePackageVersion)" />
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,32 @@
|
||||||
using BenchmarkServer.Hubs;
|
using BenchmarkServer.Hubs;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace BenchmarkServer
|
namespace BenchmarkServer
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
|
private readonly IConfiguration _config;
|
||||||
|
public Startup(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_config = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSignalR(o =>
|
var signalrBuilder = services.AddSignalR(o =>
|
||||||
{
|
{
|
||||||
o.EnableDetailedErrors = true;
|
o.EnableDetailedErrors = true;
|
||||||
})
|
})
|
||||||
.AddMessagePackProtocol();
|
.AddMessagePackProtocol();
|
||||||
|
|
||||||
|
var redisConnectionString = _config["SignalRRedis"];
|
||||||
|
if (!string.IsNullOrEmpty(redisConnectionString))
|
||||||
|
{
|
||||||
|
signalrBuilder.AddRedis(redisConnectionString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue