mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-18 22:38:16 +08:00
hacked together load balancing reroutes in fileconfig (#211)
* hacked together load balancing reroutes in fileconfig * some renaming and refactoring * more renames * hacked away the old config json * test for issue 213 * renamed key * dont share ports * oops * updated docs * mvoed docs around * port being used
This commit is contained in:
@ -1,40 +1,40 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using BenchmarkDotNet.Columns;
|
||||
using BenchmarkDotNet.Configs;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
|
||||
namespace Ocelot.Benchmarks
|
||||
{
|
||||
[Config(typeof(UrlPathToUrlPathTemplateMatcherBenchmarks))]
|
||||
public class UrlPathToUrlPathTemplateMatcherBenchmarks : ManualConfig
|
||||
{
|
||||
private RegExUrlMatcher _urlPathMatcher;
|
||||
private string _downstreamUrlPath;
|
||||
private string _downstreamUrlPathTemplate;
|
||||
|
||||
public UrlPathToUrlPathTemplateMatcherBenchmarks()
|
||||
{
|
||||
Add(StatisticColumn.AllStatistics);
|
||||
}
|
||||
|
||||
[Setup]
|
||||
public void SetUp()
|
||||
{
|
||||
_urlPathMatcher = new RegExUrlMatcher();
|
||||
_downstreamUrlPath = "api/product/products/1/variants/?soldout=false";
|
||||
_downstreamUrlPathTemplate = "api/product/products/{productId}/variants/";
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void Benchmark1()
|
||||
{
|
||||
_urlPathMatcher.Match(_downstreamUrlPath, _downstreamUrlPathTemplate);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void Benchmark2()
|
||||
{
|
||||
_urlPathMatcher.Match(_downstreamUrlPath, _downstreamUrlPathTemplate);
|
||||
}
|
||||
}
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using BenchmarkDotNet.Columns;
|
||||
using BenchmarkDotNet.Configs;
|
||||
using Ocelot.DownstreamRouteFinder.UrlMatcher;
|
||||
|
||||
namespace Ocelot.Benchmarks
|
||||
{
|
||||
[Config(typeof(UrlPathToUrlPathTemplateMatcherBenchmarks))]
|
||||
public class UrlPathToUrlPathTemplateMatcherBenchmarks : ManualConfig
|
||||
{
|
||||
private RegExUrlMatcher _urlPathMatcher;
|
||||
private string _downstreamUrlPath;
|
||||
private string _downstreamUrlPathTemplate;
|
||||
|
||||
public UrlPathToUrlPathTemplateMatcherBenchmarks()
|
||||
{
|
||||
Add(StatisticColumn.AllStatistics);
|
||||
}
|
||||
|
||||
[Setup]
|
||||
public void SetUp()
|
||||
{
|
||||
_urlPathMatcher = new RegExUrlMatcher();
|
||||
_downstreamUrlPath = "api/product/products/1/variants/?soldout=false";
|
||||
_downstreamUrlPathTemplate = "api/product/products/{productId}/variants/";
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void Benchmark1()
|
||||
{
|
||||
_urlPathMatcher.Match(_downstreamUrlPath, _downstreamUrlPathTemplate);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public void Benchmark2()
|
||||
{
|
||||
_urlPathMatcher.Match(_downstreamUrlPath, _downstreamUrlPathTemplate);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user