Repository navigation
Add support for Kestrel ConnectionFilters - #109
Conversation
Pass DBNull.Value if connectionFilter is null.
| private static IConnectionFilter GetConnectionFilter(IConfigurationRoot config, IConnectionFilter prevFilter) | ||
| { | ||
| var connectionFilterValue = config["connectionFilter"]; | ||
| if (String.IsNullOrEmpty(connectionFilterValue)) |
There was a problem hiding this comment.
nit: lowercase S (we changed to that style)
| } | ||
| else | ||
| { | ||
| var connectionFilterType = Type.GetType(connectionFilterValue, throwOnError: true); |
There was a problem hiding this comment.
Do you envision us having different connection filters with no arguments? Why not make it a boolean flag? On or off?
There was a problem hiding this comment.
I could see us testing other connection filters like Logging, or a dev may want to add a custom connection filter to a branch of Benchmarks and test that. Making the connection filter a type string gives more flexibility without needing to change the BenchmarksDriver or BenchmarksServer.
There was a problem hiding this comment.
The problem is that those connection filters are non trivial to create as they have arguments. You'll end up hard coding the construction of specific filters. For example, logging https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNetCore.Server.Kestrel/Filter/LoggingConnectionFilter.cs, you'd have a pass an ILogger and for SSL https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNetCore.Server.Kestrel.Https/HttpsConnectionFilter.cs, you need to pass options. That's why the extension methods exist.
There was a problem hiding this comment.
Benchmarking the logging filter probably isn't too important. HTTPS is handled by another PR. We can always change it later, but I think this is fine for now.
There was a problem hiding this comment.
While I agree we may never actually use this to test another connection filter, it seems like a better design than adding a very specific parameter (and column in SQL) like "passthroughConnectionFilter".
|
|
connectionFilteroption to Benchmarks and automationBenchmarks.PassthroughConnectionFilterwhich just wraps the previous stream in a passthrough streammakefile.shadetarget run by CI machine@halter73, @DamianEdwards, @nathana1, @rynowak