Skip to content

Commit b965c8b

Browse files
authored
update version of akazawayun.pro (#10231)
* add new test : CSharp/akazawayun.pro * modify config and code * add content-type * update url * update package version * add 3 new tests: db、queries、updates 1. add 3 new tests: db、queries、updates; 2. split code to multi files; * - * use generated sql instead const string. * update version * fix bug of db query * set port to 8080 * 升级 akazawayun.pro 框架版本到 14 * i forget to update the port change... * test self whether work fine.. * update nuget version * why pr failed... * 不小心多提交了别人的框架...改回 * akazawayun fix bug * remove db test there is some error in mysql * confirmed there is bug in mysql.data 9.5.0 还是用8080端口吧- -b, 都用8080, 改其他的对比测时不方便 * downgrade mysql.data back to 9.4.0 * fix bug of akazawayun.pro * update version of akazawayun.pro * update version * add platform test
1 parent 57608cd commit b965c8b

File tree

13 files changed

+200
-36
lines changed

13 files changed

+200
-36
lines changed

frameworks/CSharp/akazawayun.pro/AkazawaYun.FrameworkBenchmarks.sln renamed to frameworks/CSharp/akazawayun.pro/AkazawaYun.Benchmark.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.14.36310.24 d17.14
4+
VisualStudioVersion = 17.14.36310.24
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AkazawaYun.FrameworkBenchmarks", "src/AkazawaYun.FrameworkBenchmarks.csproj", "{BB5587FE-E4A0-851D-6025-F5FF0EC54525}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AkazawaYun.Benchmark.WebApi", "src\AkazawaYun.Benchmark.WebApi\AkazawaYun.Benchmark.WebApi.csproj", "{BB5587FE-E4A0-851D-6025-F5FF0EC54525}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AkazawaYun.Benchmark.Platform", "src\AkazawaYun.Benchmark.Platform\AkazawaYun.Benchmark.Platform.csproj", "{E7CA7DF7-F4AB-47EC-BF2B-1148058CDF43}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +17,10 @@ Global
1517
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{E7CA7DF7-F4AB-47EC-BF2B-1148058CDF43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{E7CA7DF7-F4AB-47EC-BF2B-1148058CDF43}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{E7CA7DF7-F4AB-47EC-BF2B-1148058CDF43}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{E7CA7DF7-F4AB-47EC-BF2B-1148058CDF43}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 生成
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS publish
3+
WORKDIR /app
4+
COPY src/AkazawaYun.Benchmark.Platform .
5+
RUN dotnet publish -c Release -o /app/publish
6+
7+
# 运行
8+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
9+
WORKDIR /app
10+
COPY --from=publish /app/publish .
11+
12+
EXPOSE 8080
13+
ENTRYPOINT ["dotnet", "AkazawaYun.Benchmark.Platform.dll"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 生成
22
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS publish
33
WORKDIR /app
4-
COPY src .
4+
COPY src/AkazawaYun.Benchmark.WebApi .
55
RUN dotnet publish -c Release -o /app/publish
66

77
# 运行
@@ -10,4 +10,4 @@ WORKDIR /app
1010
COPY --from=publish /app/publish .
1111

1212
EXPOSE 8080
13-
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]
13+
ENTRYPOINT ["dotnet", "AkazawaYun.Benchmark.WebApi.dll"]
Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
{
2-
"framework": "akazawayun.pro",
3-
"tests": [
4-
{
5-
"default": {
6-
"display_name": "akazawayun.pro",
7-
"framework": "akazawayun.pro",
8-
"webserver": "akazawayun.pro",
9-
"plaintext_url": "/plaintext",
10-
"json_url": "/json",
11-
"db_url": "/db",
12-
"query_url": "/queries?queries=",
13-
"update_url": "/updates?queries=",
14-
"port": 8080,
15-
"classification": "Micro",
16-
"approach": "Realistic",
17-
"platform": ".NET",
18-
"language": "C#",
19-
"flavor": "CoreCLR",
20-
"os": "Linux",
21-
"database_os": "Linux",
22-
"database": "MySQL",
23-
"orm": "Micro",
24-
"notes": ""
25-
}
26-
}
27-
]
2+
"framework": "akazawayun.pro",
3+
"tests": [
4+
{
5+
"default": {
6+
"display_name": "akazawayun.pro [webapi]",
7+
"framework": "akazawayun.pro",
8+
"webserver": "akazawayun.pro",
9+
"plaintext_url": "/plaintext",
10+
"json_url": "/json",
11+
"db_url": "/db",
12+
"query_url": "/queries?queries=",
13+
"update_url": "/updates?queries=",
14+
"port": 8080,
15+
"classification": "Micro",
16+
"approach": "Realistic",
17+
"platform": ".NET",
18+
"language": "C#",
19+
"flavor": "CoreCLR",
20+
"os": "Linux",
21+
"database_os": "Linux",
22+
"database": "MySQL",
23+
"orm": "Micro",
24+
"notes": ""
25+
},
26+
"platform": {
27+
"display_name": "akazawayun.pro [platform]",
28+
"framework": "akazawayun.pro",
29+
"webserver": "akazawayun.pro",
30+
"plaintext_url": "/plaintext",
31+
"json_url": "/json",
32+
"port": 8080,
33+
"classification": "Platform",
34+
"approach": "Realistic",
35+
"platform": ".NET",
36+
"language": "C#",
37+
"flavor": "CoreCLR",
38+
"os": "Linux",
39+
"database_os": "Linux",
40+
"notes": ""
41+
}
42+
}
43+
]
2844
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<EnableSourceGenerator>true</EnableSourceGenerator>
9+
<PublishAot>false</PublishAot>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
14+
<ServerGarbageCollection>true</ServerGarbageCollection>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="AkazawaYun.PRO" Version="1.14.25.1103" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma warning disable IDE1006,CS8981
2+
using System.Text.Json.Serialization;
3+
4+
namespace AkazawaYun.Benchmark.Platform;
5+
6+
7+
[JsonSerializable(typeof(JsonModel))]
8+
public partial class AotJsonContext : JsonSerializerContext { }
9+
10+
11+
public class JsonModel
12+
{
13+
public string? message { get; set; }
14+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using AkazawaYun.PRO7;
2+
using System.Text;
3+
4+
namespace AkazawaYun.Benchmark.Platform;
5+
6+
class MyBenchmarkReceptor : akzWebReceptorBenchmark
7+
{
8+
readonly JsonModel JsonModel;
9+
readonly ReadOnlyMemory<byte> JsonContentLength;
10+
11+
12+
public MyBenchmarkReceptor()
13+
{
14+
JsonModel = new()
15+
{
16+
message = "Hello, World!"
17+
};
18+
akzJson.Text2Json(JsonModel, out ReadOnlyMemory<byte> json);
19+
JsonContentLength = Encoding.UTF8.GetBytes($"{json.Length}\r\n\r\n");
20+
}
21+
22+
23+
public override ValueTask SendPlaintext(IHttpContext http)
24+
{
25+
return base.SendPlaintext(http);
26+
}
27+
public override async ValueTask SendJson(IHttpContext http)
28+
{
29+
await http.Slient.Send(DataJson_OnlyHeaderExceptContentLength);
30+
await http.Slient.Send(JsonContentLength);
31+
akzJson.Text2Json(JsonModel, out ReadOnlyMemory<byte> json);
32+
await http.Slient.Send(json);
33+
}
34+
public override ValueTask SendDb(IHttpContext http)
35+
{
36+
throw new NotImplementedException();
37+
}
38+
public override ValueTask SendQueries(IHttpContext http)
39+
{
40+
throw new NotImplementedException();
41+
}
42+
public override ValueTask SendUpdates(IHttpContext http)
43+
{
44+
throw new NotImplementedException();
45+
}
46+
public override ValueTask SendCachedQueries(IHttpContext http)
47+
{
48+
throw new NotImplementedException();
49+
}
50+
public override ValueTask SendFortunes(IHttpContext http)
51+
{
52+
throw new NotImplementedException();
53+
}
54+
55+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using AkazawaYun.PRO7;
2+
3+
namespace AkazawaYun.Benchmark.Platform;
4+
5+
class Program
6+
{
7+
static readonly akzWebBuilder builder;
8+
const int port = 8080;
9+
10+
static Program()
11+
{
12+
akzLog.War("AkazawaYun.PRO 压力测试特供版 ver2025.11.3, 只支持 /plaintext 和 /json");
13+
akzJson.Config(null, AotJsonContext.Default);
14+
builder = akzWebBuilder.Shared.SetPort(port).SetDev(true)
15+
.Add<akzXmlSummary, akzXmlSummary>(() => null)
16+
.Add<IWebReceptor, MyBenchmarkReceptor>(() => new MyBenchmarkReceptor())
17+
.Add<IWebListener, akzHttpListenerVIBenchmark>(() => new(port)
18+
{
19+
LogLevel = 0
20+
}).Build();
21+
}
22+
static async Task Main()
23+
{
24+
await builder.Launch();
25+
26+
akzLog.Inf("[API SELF-TEST]");
27+
string url = $"http://localhost:{port}/plaintext";
28+
akzLog.Inf(" REQ URL :" + url);
29+
string res = await akzHttpClient.Shared.Get(url).FetchString();
30+
akzLog.Inf(" RES LEN :" + res.Length);
31+
akzLog.Inf(" RES BODY:" + res);
32+
akzLog.Inf("[OK, I WORK FINE]");
33+
34+
akzLog.Default = akzLog.Output.NoneButWar;
35+
await Task.Delay(-1);
36+
}
37+
}

frameworks/CSharp/akazawayun.pro/src/AkazawaYun.FrameworkBenchmarks.csproj renamed to frameworks/CSharp/akazawayun.pro/src/AkazawaYun.Benchmark.WebApi/AkazawaYun.Benchmark.WebApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AkazawaYun.PRO" Version="1.14.25.1027" />
18+
<PackageReference Include="AkazawaYun.PRO" Version="1.14.25.1103" />
1919
<PackageReference Include="MySql.Data" Version="9.4.0" />
2020
</ItemGroup>
2121

frameworks/CSharp/akazawayun.pro/src/Model.cs renamed to frameworks/CSharp/akazawayun.pro/src/AkazawaYun.Benchmark.WebApi/Model.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using AkazawaYun.AOT;
33
using System.Text.Json.Serialization;
44

5-
namespace AkazawaYun.FrameworkBenchmarks;
5+
namespace AkazawaYun.Benchmark.WebApi;
66

77

88
[JsonSerializable(typeof(JsonModel))]

0 commit comments

Comments
 (0)