Skip to content

Commit 0597580

Browse files
litongjavalitongjava
andauthored
Tio server (#8659)
* add tio-server * add simple docker file * fix docker file * chage log level to info * add template and activate record * add cache * update reupadme.md * update cache query * test on windows * chage to EnviormentUtils * add java run with jdb info * add EnviormentUtils * change to JDBC_URL * add mysql run cmd * update dockerfile add jdbc info * fix jdbc info error * fix Unterminated quoted string on dockerfile * fix jdb_user error * add "database": "MySQL", * chage in to Integer of Fortune * add #escape to avoid xxs * remove caffeine and add ehcache * failed to test native * change to cached_query_url * add native arg * remove unused file for tio-http-server * add dockerignore * update jar name to tio-http-server-benchmark * update version * fix all query * update docker file * update docker file and plugin * update docker file * update dockerfile * update tio-http-server version * remove native support * update tio-http-server version * update jdbc info * update docker file --------- Co-authored-by: litongjava <[email protected]>
1 parent 989d88d commit 0597580

28 files changed

+1293
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.github
2+
.git
3+
.DS_Store
4+
docs
5+
kubernetes
6+
node_modules
7+
/.svelte-kit
8+
/package
9+
.env
10+
.env.*
11+
vite.config.js.timestamp-*
12+
vite.config.ts.timestamp-*
13+
__pycache__
14+
.env
15+
_old
16+
uploads
17+
.ipynb_checkpoints
18+
**/*.db
19+
_test
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target/
2+
logs
3+
.settings
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# t-io Benchmarking Test
2+
3+
This is the tio-server portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
4+
5+
## Controller
6+
7+
These implementations use the tio-server's controller.
8+
9+
### Plaintext Test
10+
11+
* [Plaintext test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)
12+
13+
### JSON Serialization Test
14+
15+
* [JSON test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java)
16+
17+
### Database Query Test
18+
19+
* [Database Query test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
20+
21+
### Database Queries Test
22+
23+
* [Database Queries test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
24+
25+
### Database Update Test
26+
27+
* [Database Update test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
28+
29+
### Template rendering Test
30+
31+
* [Template rendering test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java))
32+
33+
### Cache Query Test
34+
* [Cache query test source](src/main/java/com/litongjava/tio/http/server/controller/CacheController.java))
35+
36+
37+
## Versions
38+
3.7.3.v20231218-RELEASE (https://gitee.com/litongjava/t-io)
39+
40+
## Test URLs
41+
42+
All implementations use the same URLs.
43+
44+
### Plaintext Test
45+
46+
http://localhost:8080/plaintext
47+
48+
### JSON Encoding Test
49+
50+
http://localhost:8080/json
51+
52+
### Database Query Test
53+
54+
http://localhost:8080/db
55+
56+
### Database Queries Test
57+
58+
http://localhost:8080/queries?queries=5
59+
60+
### Cache Query Test
61+
62+
http://localhost:8080/cacheQuery?queries=10000
63+
64+
### Template rendering Test
65+
66+
http://localhost:8080/fortunes
67+
68+
### Database Update Test
69+
70+
http://localhost:8080/updates?queries=5
71+
72+
## Hot to run
73+
### install mysql 8
74+
- 1.please instal mysql 8.0.32,example cmd
75+
```
76+
docker run --restart=always -d --name mysql_8 --hostname mysql \
77+
-p 3306:3306 \
78+
-e 'MYSQL_ROOT_PASSWORD=robot_123456#' -e 'MYSQL_ROOT_HOST=%' -e 'MYSQL_DATABASE=hello_world' \
79+
mysql/mysql-server:8.0.32 \
80+
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1
81+
```
82+
- 2.create database schema hello_world
83+
- 3.create tablle,[example](sql/hello_world.sql)
84+
- 4.import data
85+
86+
### docker
87+
```
88+
docker build -t tio-server-benchmark -f tio-server.dockerfile .
89+
```
90+
The run is to specify the mysql database
91+
```
92+
docker run --rm -p 8080:8080 \
93+
-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \
94+
-e JDBC_USER="root" \
95+
-e JDBC_PSWD="robot_123456#" \
96+
tio-server-benchmark
97+
```
98+
99+
### windows
100+
101+
-windows
102+
```
103+
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false --JDBC_USER=root --JDBC_PSWD=robot_123456#
104+
```
105+
or
106+
```
107+
set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world
108+
set jdbc.user=root
109+
set JDBC_PSWD=robot_123456#
110+
D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar
111+
```
112+
113+
114+
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
---
2+
title: tio-server-benchmark v1.0.0
3+
language_tabs:
4+
- shell: Shell
5+
- http: HTTP
6+
- javascript: JavaScript
7+
- ruby: Ruby
8+
- python: Python
9+
- php: PHP
10+
- java: Java
11+
- go: Go
12+
toc_footers: []
13+
includes: []
14+
search: true
15+
code_clipboard: true
16+
highlight_theme: darkula
17+
headingLevel: 2
18+
generator: "@tarslib/widdershins v4.0.17"
19+
20+
---
21+
22+
# tio-server-benchmark
23+
24+
> v1.0.0
25+
26+
Base URLs:
27+
28+
# Authentication
29+
30+
# Default
31+
32+
## GET plaintext
33+
34+
GET /plaintext
35+
36+
> 返回示例
37+
38+
> 200 Response
39+
40+
```json
41+
{}
42+
```
43+
44+
### 返回结果
45+
46+
|状态码|状态码含义|说明|数据模型|
47+
|---|---|---|---|
48+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
49+
50+
### 返回数据结构
51+
52+
## GET json
53+
54+
GET /json
55+
56+
> 返回示例
57+
58+
> 200 Response
59+
60+
```json
61+
{}
62+
```
63+
64+
### 返回结果
65+
66+
|状态码|状态码含义|说明|数据模型|
67+
|---|---|---|---|
68+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
69+
70+
### 返回数据结构
71+
72+
## GET db
73+
74+
GET /db
75+
76+
### 请求参数
77+
78+
|名称|位置|类型|必选|说明|
79+
|---|---|---|---|---|
80+
|id|query|string||none|
81+
82+
> 返回示例
83+
84+
> 200 Response
85+
86+
```json
87+
{
88+
"id": 0,
89+
"randomNumber": 0
90+
}
91+
```
92+
93+
### 返回结果
94+
95+
|状态码|状态码含义|说明|数据模型|
96+
|---|---|---|---|
97+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
98+
99+
### 返回数据结构
100+
101+
状态码 **200**
102+
103+
|名称|类型|必选|约束|中文名|说明|
104+
|---|---|---|---|---|---|
105+
|» id|integer|true|none||none|
106+
|» randomNumber|integer|true|none||none|
107+
108+
## GET updates
109+
110+
GET /updates
111+
112+
### 请求参数
113+
114+
|名称|位置|类型|必选|说明|
115+
|---|---|---|---|---|
116+
|queries|query|string||none|
117+
118+
> 返回示例
119+
120+
> 成功
121+
122+
```json
123+
[
124+
{
125+
"id": 28,
126+
"randomNumber": 5399,
127+
"randomnumber": 1498
128+
}
129+
]
130+
```
131+
132+
### 返回结果
133+
134+
|状态码|状态码含义|说明|数据模型|
135+
|---|---|---|---|
136+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
137+
138+
### 返回数据结构
139+
140+
状态码 **200**
141+
142+
|名称|类型|必选|约束|中文名|说明|
143+
|---|---|---|---|---|---|
144+
|» id|integer|false|none||none|
145+
|» randomNumber|integer|false|none||none|
146+
|» randomnumber|integer|false|none||none|
147+
148+
## GET fortunes
149+
150+
GET /fortunes
151+
152+
> 返回示例
153+
154+
> 200 Response
155+
156+
```json
157+
{}
158+
```
159+
160+
### 返回结果
161+
162+
|状态码|状态码含义|说明|数据模型|
163+
|---|---|---|---|
164+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
165+
166+
### 返回数据结构
167+
168+
## GET cacheQuery
169+
170+
GET /cacheQuery
171+
172+
### 请求参数
173+
174+
|名称|位置|类型|必选|说明|
175+
|---|---|---|---|---|
176+
|queries|query|string||none|
177+
178+
> 返回示例
179+
180+
> 200 Response
181+
182+
```json
183+
[
184+
{
185+
"id": 0,
186+
"randomNumber": 0
187+
}
188+
]
189+
```
190+
191+
### 返回结果
192+
193+
|状态码|状态码含义|说明|数据模型|
194+
|---|---|---|---|
195+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
196+
197+
### 返回数据结构
198+
199+
状态码 **200**
200+
201+
|名称|类型|必选|约束|中文名|说明|
202+
|---|---|---|---|---|---|
203+
|» id|integer|false|none||none|
204+
|» randomNumber|integer|false|none||none|
205+
206+
## GET cacheList
207+
208+
GET /cacheList
209+
210+
> 返回示例
211+
212+
> 200 Response
213+
214+
```json
215+
{}
216+
```
217+
218+
### 返回结果
219+
220+
|状态码|状态码含义|说明|数据模型|
221+
|---|---|---|---|
222+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline|
223+
224+
### 返回数据结构
225+
226+
# 数据模型
227+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"framework": "tio-server",
3+
"tests": [{
4+
"default": {
5+
"plaintext_url": "/plaintext",
6+
"json_url": "/json",
7+
"db_url": "/db",
8+
"query_url": "/queries?queries=",
9+
"fortune_url": "/fortunes",
10+
"update_url": "/updates?queries=",
11+
"cached_query_url" : "/cachedQuery?queries=",
12+
"port": 8080,
13+
"approach": "Realistic",
14+
"classification": "Micro",
15+
"database": "MySQL",
16+
"framework": "tio-server",
17+
"language": "Java",
18+
"flavor": "None",
19+
"orm": "Raw",
20+
"platform": "t-io",
21+
"webserver": "None",
22+
"os": "Linux",
23+
"database_os": "Linux",
24+
"display_name": "tio-server",
25+
"notes": "tio-server",
26+
"versus": "t-io"
27+
}
28+
}]
29+
}

0 commit comments

Comments
 (0)