diff --git a/frameworks/CSharp/wiredio/.gitignore b/frameworks/CSharp/wiredio/.gitignore new file mode 100644 index 00000000000..c8d1eed0116 --- /dev/null +++ b/frameworks/CSharp/wiredio/.gitignore @@ -0,0 +1,38 @@ +[Oo]bj/ +[Bb]in/ +TestResults/ +.nuget/ +*.sln +*.sln.ide/ +_ReSharper.*/ +.idea/ +packages/ +artifacts/ +PublishProfiles/ +.vs/ +*.user +*.suo +*.cache +*.docstates +_ReSharper.* +nuget.exe +*net45.csproj +*net451.csproj +*k10.csproj +*.psess +*.vsp +*.pidb +*.userprefs +*DS_Store +*.ncrunchsolution +*.*sdf +*.ipch +*.swp +*~ +.build/ +.testPublish/ +launchSettings.json +BenchmarkDotNet.Artifacts/ +BDN.Generated/ +binaries/ +global.json diff --git a/frameworks/CSharp/wiredio/Benchmarks/Benchmarks.csproj b/frameworks/CSharp/wiredio/Benchmarks/Benchmarks.csproj new file mode 100644 index 00000000000..627c09fb8c8 --- /dev/null +++ b/frameworks/CSharp/wiredio/Benchmarks/Benchmarks.csproj @@ -0,0 +1,23 @@ + + + + Exe + net9.0 + 13.0 + enable + enable + + true + true + + + linux-musl-x64 + true + + + + + + + + diff --git a/frameworks/CSharp/wiredio/Benchmarks/Program.cs b/frameworks/CSharp/wiredio/Benchmarks/Program.cs new file mode 100644 index 00000000000..8a41b222386 --- /dev/null +++ b/frameworks/CSharp/wiredio/Benchmarks/Program.cs @@ -0,0 +1,32 @@ +using System.Net; +using System.Text.Json; +using Wired.IO.App; +using Wired.IO.Http11.Response.Content; +using Wired.IO.Protocol.Response; +using StringContent = Wired.IO.Http11.Response.Content.StringContent; + +var builder = WiredApp.CreateBuilder(); + +await builder + .Endpoint(IPAddress.Any, 8080) + .MapGet("/plaintext", scope => context => + { + context + .Respond() + .Status(ResponseStatus.Ok) + .Content(new StringContent("Hello, World!")) + .Type("text/plain"); + }) + .MapGet("/json", scope => context => + { + context + .Respond() + .Status(ResponseStatus.Ok) + .Content(new JsonContent(new + { + Message = "Hello, World!" + }, JsonSerializerOptions.Default)) + .Type("application/json"); + }) + .Build() + .RunAsync(); \ No newline at end of file diff --git a/frameworks/CSharp/wiredio/README.md b/frameworks/CSharp/wiredio/README.md new file mode 100644 index 00000000000..4f137ae45c2 --- /dev/null +++ b/frameworks/CSharp/wiredio/README.md @@ -0,0 +1,22 @@ +# Wired.IO Tests on Linux + +See the [Wired.IO Documentation](https://mda2av.github.io/Wired.IO.Docs/) for more information. + +## Infrastructure Software Versions + +**Language** + +* C# 13.0 + +**Platforms** + +* .NET 8/9 + +**Web Servers** + +* [Wired.IO](https://github.com/MDA2AV/Wired.IO) + +## Paths & Source for Tests + +* [Plaintext](Benchmarks/Program.cs): "/plaintext" +* [JSON](Benchmarks/Program.cs): "/json" diff --git a/frameworks/CSharp/wiredio/benchmark_config.json b/frameworks/CSharp/wiredio/benchmark_config.json new file mode 100644 index 00000000000..f136d0588b7 --- /dev/null +++ b/frameworks/CSharp/wiredio/benchmark_config.json @@ -0,0 +1,24 @@ +{ + "framework": "wiredio", + "tests": [ + { + "default": { + "plaintext_url": "/plaintext", + "json_url": "/json", + "port": 8080, + "approach": "Realistic", + "classification": "Fullstack", + "database": "None", + "framework": "Wired.IO", + "language": "C#", + "orm": "None", + "platform": ".NET", + "webserver": "Wired.IO", + "os": "Linux", + "database_os": "Linux", + "display_name": "Wired.IO", + "notes": "Only plaintext and JSON benchmarks implemented" + } + } + ] +} \ No newline at end of file diff --git a/frameworks/CSharp/wiredio/config.toml b/frameworks/CSharp/wiredio/config.toml new file mode 100644 index 00000000000..55e724fde37 --- /dev/null +++ b/frameworks/CSharp/wiredio/config.toml @@ -0,0 +1,14 @@ +[framework] +name = "wiredio" + +[main] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Fullstack" +os = "Linux" +database_os = "Linux" +orm = "None" +platform = ".NET" +webserver = "Wired.IO" +versus = "None" diff --git a/frameworks/CSharp/wiredio/wiredio.dockerfile b/frameworks/CSharp/wiredio/wiredio.dockerfile new file mode 100644 index 00000000000..8c473477a61 --- /dev/null +++ b/frameworks/CSharp/wiredio/wiredio.dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build +WORKDIR /source + +# copy csproj and restore as distinct layers +COPY Benchmarks/*.csproj . +RUN dotnet restore -r linux-musl-x64 + +# copy and publish app and libraries +COPY Benchmarks/ . +RUN dotnet publish -c release -o /app -r linux-musl-x64 --no-restore --self-contained + +# final stage/image +FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine + +ENV DOTNET_GCDynamicAdaptationMode=0 +ENV DOTNET_ReadyToRun=0 +ENV DOTNET_HillClimbing_Disable=1 + +WORKDIR /app +COPY --from=build /app . + +ENTRYPOINT ["./Benchmarks"] + +EXPOSE 8080