Skip to content
Closed
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
2 changes: 1 addition & 1 deletion frameworks/CSharp/akazawayun.pro/akazawayun.pro.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
WORKDIR /app
COPY --from=publish /app/publish .

EXPOSE 2022
EXPOSE 8080
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]
12 changes: 6 additions & 6 deletions frameworks/CSharp/akazawayun.pro/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"display_name": "akazawayun.pro",
"framework": "akazawayun.pro",
"webserver": "akazawayun.pro",
"plaintext_url": "/post/plaintext",
"json_url": "/post/json",
"db_url": "/post/db",
"query_url": "/post/queries?queries=",
"update_url": "/post/updates?queries=",
"port": 2022,
"plaintext_url": "/plaintext",
"json_url": "/json",
"db_url": "/db",
"query_url": "/queries?queries=",
"update_url": "/updates?queries=",
"port": 8080,
"classification": "Micro",
"approach": "Realistic",
"platform": ".NET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AkazawaYun.PRO" Version="1.13.25.816" />
<PackageReference Include="MySql.Data" Version="9.4.0" />
<PackageReference Include="AkazawaYun.PRO" Version="1.14.25.1025" />
<PackageReference Include="MySql.Data" Version="9.5.0" />
</ItemGroup>

</Project>
30 changes: 23 additions & 7 deletions frameworks/CSharp/akazawayun.pro/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

using AkazawaYun.AOT;
using AkazawaYun.PRO7;
using AkazawaYun.PRO7.AkazawaYunWebFunctionAOP;
using AkazawaYun.PRO7.AkazawaYunWebInterceptor;
using System.Diagnostics.CodeAnalysis;

namespace AkazawaYun.FrameworkBenchmarks;

Expand All @@ -17,16 +14,16 @@ class Program : IPostFunctionWrapper
static Program()
{
akzJson.Config(null, AotJsonContext.Default);
builder = akzWebBuilder.Shared.SetDefault()
builder = akzWebBuilder.Shared.SetPort(8080)
.Build()
.Config<IWebReceptor, akzWebInterceptor>(itc =>
{
itc.ClearInterceptor();
itc.AddInterceptor(new akzWebInterceptorNotOnlyPost());
itc.AddInterceptor(new akzWebInterceptorAsPost());
});
mysql = new akzDbBuilderII()
.SetServer("tfb-database:3306")
//.SetServer("localhost:3306")
.SetServer("tfb-database")
//.SetServer("localhost")
.SetUser("benchmarkdbuser")
.SetPwd("benchmarkdbpass")
.SetDatabase("hello_world")
Expand All @@ -37,6 +34,15 @@ static Program()
static async Task Main()
{
await builder.Launch();

akzLog.Inf("[API SELF-TEST]");
string url = "http://localhost:8080/plaintext";
akzLog.Inf(" REQ URL :" + url);
string res = await akzHttpClient.Shared.Get(url).FetchString();
akzLog.Inf(" RES LEN :" + res.Length);
akzLog.Inf(" RES BODY:" + res);
akzLog.Inf("[OK, I WORK FINE]");

akzLog.Default = akzLog.Output.None;
await Task.Delay(-1);
}
Expand Down Expand Up @@ -91,3 +97,13 @@ static int ParseCount(string queries)
}

}


public class akzWebInterceptorAsPost : WebInterceptor
{
public override ValueTask<InterceptorHttpRes> Intercept(IHttpContext http)
{
http.Method = "POST";
return InterceptorHttpRes.No();
}
}
Loading