From d50f06fc3e243573c7365436dd041ede1e14330a Mon Sep 17 00:00:00 2001 From: TomPallister Date: Mon, 24 Oct 2016 19:01:20 +0100 Subject: [PATCH] Added benchmarks project back in..tho its pointless --- Ocelot.sln | 7 +++++ .../Ocelot.Benchmarks/Ocelot.Benchmarks.xproj | 21 ++++++++++++++ .../Properties/AssemblyInfo.cs | 19 +++++++++++++ ...lPathToUrlPathTemplateMatcherBenchmarks.cs | 8 ++---- test/Ocelot.Benchmarks/project.json | 28 +++++++++---------- 5 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 test/Ocelot.Benchmarks/Ocelot.Benchmarks.xproj create mode 100644 test/Ocelot.Benchmarks/Properties/AssemblyInfo.cs diff --git a/Ocelot.sln b/Ocelot.sln index 75f70f63..44348365 100644 --- a/Ocelot.sln +++ b/Ocelot.sln @@ -28,6 +28,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ocelot.AcceptanceTests", "t EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ocelot.ManualTest", "test\Ocelot.ManualTest\Ocelot.ManualTest.xproj", "{02BBF4C5-517E-4157-8D21-4B8B9E118B7A}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ocelot.Benchmarks", "test\Ocelot.Benchmarks\Ocelot.Benchmarks.xproj", "{AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -50,6 +52,10 @@ Global {02BBF4C5-517E-4157-8D21-4B8B9E118B7A}.Debug|Any CPU.Build.0 = Debug|Any CPU {02BBF4C5-517E-4157-8D21-4B8B9E118B7A}.Release|Any CPU.ActiveCfg = Release|Any CPU {02BBF4C5-517E-4157-8D21-4B8B9E118B7A}.Release|Any CPU.Build.0 = Release|Any CPU + {AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -59,5 +65,6 @@ Global {54E84F1A-E525-4443-96EC-039CBD50C263} = {5B401523-36DA-4491-B73A-7590A26E420B} {F8C224FE-36BE-45F5-9B0E-666D8F4A9B52} = {5B401523-36DA-4491-B73A-7590A26E420B} {02BBF4C5-517E-4157-8D21-4B8B9E118B7A} = {5B401523-36DA-4491-B73A-7590A26E420B} + {AB3E458C-FD76-4DEE-8DCE-EEB5BA840AF6} = {5B401523-36DA-4491-B73A-7590A26E420B} EndGlobalSection EndGlobal diff --git a/test/Ocelot.Benchmarks/Ocelot.Benchmarks.xproj b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.xproj new file mode 100644 index 00000000..9237c040 --- /dev/null +++ b/test/Ocelot.Benchmarks/Ocelot.Benchmarks.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + ab3e458c-fd76-4dee-8dce-eeb5ba840af6 + Ocelot.Benchmarks + .\obj + .\bin\ + v4.6.1 + + + + 2.0 + + + diff --git a/test/Ocelot.Benchmarks/Properties/AssemblyInfo.cs b/test/Ocelot.Benchmarks/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..afb45e9f --- /dev/null +++ b/test/Ocelot.Benchmarks/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Ocelot.Benchmarks")] +[assembly: AssemblyTrademark("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ab3e458c-fd76-4dee-8dce-eeb5ba840af6")] diff --git a/test/Ocelot.Benchmarks/UrlPathToUrlPathTemplateMatcherBenchmarks.cs b/test/Ocelot.Benchmarks/UrlPathToUrlPathTemplateMatcherBenchmarks.cs index c88cbc69..7723ce54 100644 --- a/test/Ocelot.Benchmarks/UrlPathToUrlPathTemplateMatcherBenchmarks.cs +++ b/test/Ocelot.Benchmarks/UrlPathToUrlPathTemplateMatcherBenchmarks.cs @@ -1,16 +1,14 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Jobs; -using Ocelot.Library.Infrastructure.UrlPathMatcher; - +using Ocelot.DownstreamRouteFinder.UrlMatcher; namespace Ocelot.Benchmarks { [Config(typeof(UrlPathToUrlPathTemplateMatcherBenchmarks))] public class UrlPathToUrlPathTemplateMatcherBenchmarks : ManualConfig { - private UrlPathToUrlPathTemplateMatcher _urlPathMatcher; + private RegExUrlMatcher _urlPathMatcher; private string _downstreamUrlPath; private string _downstreamUrlPathTemplate; @@ -22,7 +20,7 @@ namespace Ocelot.Benchmarks [Setup] public void SetUp() { - _urlPathMatcher = new UrlPathToUrlPathTemplateMatcher(); + _urlPathMatcher = new RegExUrlMatcher(); _downstreamUrlPath = "api/product/products/1/variants/?soldout=false"; _downstreamUrlPathTemplate = "api/product/products/{productId}/variants/"; } diff --git a/test/Ocelot.Benchmarks/project.json b/test/Ocelot.Benchmarks/project.json index da710bc9..d835ac61 100644 --- a/test/Ocelot.Benchmarks/project.json +++ b/test/Ocelot.Benchmarks/project.json @@ -1,20 +1,20 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, + "version": "1.0.0-*", + "buildOptions": { + "emitEntryPoint": true + }, - "dependencies": { - "Microsoft.NETCore.App": { + "dependencies": { + "Microsoft.NETCore.App": { "version": "1.0.0", "type": "platform" + }, + "BenchmarkDotNet": "0.9.8", + "Ocelot": "1.0.0-*" }, - "BenchmarkDotNet": "0.9.8", - "Ocelot.Library": "1.0.0-*" - }, - "frameworks": { - "netcoreapp1.0": { + "frameworks": { + "netcoreapp1.4": { "imports": [ "dotnet5.6", "portable-net45+win8" @@ -22,7 +22,7 @@ } }, - "tooling": { - "defaultNamespace": "Ocelot.Benchmarks" - } + "tooling": { + "defaultNamespace": "Ocelot.Benchmarks" + } }