Skip to content

Commit 66f404f

Browse files
authored
update akazawayun.pro version (#10211)
* 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
1 parent 2d41e60 commit 66f404f

File tree

6 files changed

+60
-17
lines changed

6 files changed

+60
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ benchmark.cfg
6969

7070
# python
7171
.venv/
72+
frameworks/CSharp/akazawayun.pro/Dockerfile
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36310.24 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AkazawaYun.FrameworkBenchmarks", "src/AkazawaYun.FrameworkBenchmarks.csproj", "{BB5587FE-E4A0-851D-6025-F5FF0EC54525}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {81EA49A3-BB25-4EC5-B861-02520931CF63}
24+
EndGlobalSection
25+
EndGlobal

frameworks/CSharp/akazawayun.pro/akazawayun.pro.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
99
WORKDIR /app
1010
COPY --from=publish /app/publish .
1111

12-
EXPOSE 2022
12+
EXPOSE 8080
1313
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]

frameworks/CSharp/akazawayun.pro/benchmark_config.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"display_name": "akazawayun.pro",
77
"framework": "akazawayun.pro",
88
"webserver": "akazawayun.pro",
9-
"plaintext_url": "/post/plaintext",
10-
"json_url": "/post/json",
11-
"db_url": "/post/db",
12-
"query_url": "/post/queries?queries=",
13-
"update_url": "/post/updates?queries=",
14-
"port": 2022,
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,
1515
"classification": "Micro",
1616
"approach": "Realistic",
1717
"platform": ".NET",

frameworks/CSharp/akazawayun.pro/src/AkazawaYun.FrameworkBenchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

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

frameworks/CSharp/akazawayun.pro/src/Program.cs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,32 @@
22

33
using AkazawaYun.AOT;
44
using AkazawaYun.PRO7;
5-
using AkazawaYun.PRO7.AkazawaYunWebFunctionAOP;
6-
using AkazawaYun.PRO7.AkazawaYunWebInterceptor;
7-
using System.Diagnostics.CodeAnalysis;
85

96
namespace AkazawaYun.FrameworkBenchmarks;
107

118
class Program : IPostFunctionWrapper
129
{
1310
static readonly akzWebBuilder builder;
1411
static readonly akzDbFactory mysql;
15-
12+
const int port = 8080;
1613

1714
static Program()
1815
{
1916
akzJson.Config(null, AotJsonContext.Default);
20-
builder = akzWebBuilder.Shared.SetDefault()
17+
builder = akzWebBuilder.Shared.SetPort(port)
2118
.Build()
2219
.Config<IWebReceptor, akzWebInterceptor>(itc =>
2320
{
2421
itc.ClearInterceptor();
25-
itc.AddInterceptor(new akzWebInterceptorNotOnlyPost());
22+
itc.AddInterceptor(new akzWebInterceptorAsPost());
2623
});
2724
mysql = new akzDbBuilderII()
28-
.SetServer("tfb-database:3306")
25+
.SetServer("tfb-database")
2926
//.SetServer("localhost:3306")
3027
.SetUser("benchmarkdbuser")
28+
//.SetUser("root")
3129
.SetPwd("benchmarkdbpass")
30+
//.SetPwd("123456")
3231
.SetDatabase("hello_world")
3332
.SetCharset()
3433
.SetOtherset()
@@ -37,7 +36,16 @@ static Program()
3736
static async Task Main()
3837
{
3938
await builder.Launch();
40-
akzLog.Default = akzLog.Output.None;
39+
40+
akzLog.Inf("[API SELF-TEST]");
41+
string url = $"http://localhost:{port}/plaintext";
42+
akzLog.Inf(" REQ URL :" + url);
43+
string res = await akzHttpClient.Shared.Get(url).FetchString();
44+
akzLog.Inf(" RES LEN :" + res.Length);
45+
akzLog.Inf(" RES BODY:" + res);
46+
akzLog.Inf("[OK, I WORK FINE]");
47+
48+
akzLog.Default = akzLog.Output.NoneButWar;
4149
await Task.Delay(-1);
4250
}
4351

@@ -91,3 +99,12 @@ static int ParseCount(string queries)
9199
}
92100

93101
}
102+
103+
public class akzWebInterceptorAsPost : WebInterceptor
104+
{
105+
public override ValueTask<InterceptorHttpRes> Intercept(IHttpContext http)
106+
{
107+
http.Method = "POST";
108+
return InterceptorHttpRes.No();
109+
}
110+
}

0 commit comments

Comments
 (0)