Skip to content

Add Wired.IO framework #10022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions frameworks/CSharp/wiredio/.gitignore
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions frameworks/CSharp/wiredio/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>13.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<ServerGarbageCollection>true</ServerGarbageCollection>
<TieredPGO>true</TieredPGO>

<!-- Required for self-contained publish -->
<RuntimeIdentifier>linux-musl-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Wired.IO" Version="9.2.0" />
</ItemGroup>

</Project>
32 changes: 32 additions & 0 deletions frameworks/CSharp/wiredio/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -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();
22 changes: 22 additions & 0 deletions frameworks/CSharp/wiredio/README.md
Original file line number Diff line number Diff line change
@@ -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"
24 changes: 24 additions & 0 deletions frameworks/CSharp/wiredio/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
14 changes: 14 additions & 0 deletions frameworks/CSharp/wiredio/config.toml
Original file line number Diff line number Diff line change
@@ -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"
24 changes: 24 additions & 0 deletions frameworks/CSharp/wiredio/wiredio.dockerfile
Original file line number Diff line number Diff line change
@@ -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