Skip to content

Commit

Permalink
Doc fix (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
eipi1 authored Aug 8, 2023
1 parent 4d53a4f commit d4abf17
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
### Start Test
The following request will send two `GET` request per second(`"countPerSec": 2`) to `httpbin.org/get` for 120
seconds(`"duration": 60`).
seconds(`"duration": 120`). More example can be found in [test cases](https://github.com/eipi1/overload/tree/main/tests/src/resources)
```shell
curl --location --request POST '{overload-host}:3030/test' \
--header 'Content-Type: application/json' \
Expand All @@ -100,7 +100,7 @@ Sample JSON request body -
"name": "demo-test",
"qps": {
"ConstantRate": {
"countPerSec": 1
"countPerSec": 2
}
},
"req": {
Expand Down
58 changes: 49 additions & 9 deletions docs/src/api/api-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,70 @@ Sample JSON request body -
# use overload_http::Request;
# let req = r###"
{
"duration": 120,
"name": "demo-test",
"duration": 800,
"name": "test-overload",
"histogram_buckets": [
1,
2,
5,
7,
10,
15
],
"qps": {
"ConstantRate": {
"countPerSec": 1
"Linear": {
"a": 1,
"b": 1,
"max": 100
}
},
"req": {
"RequestList": {
"data": [
{
"body": null,
"method": "GET",
"url": "/get"
"url": "/serde",
"headers": {
"Host": "127.0.0.1:2000",
"Connection": "keep-alive"
}
}
]
}
},
"target": {
"host": "httpbin.org",
"port": 80,
"host": "172.17.0.1",
"port": 2000,
"protocol": "HTTP"
},
"histogramBuckets": [35,40,45,48,50, 52]
"concurrentConnection": {
"Linear": {
"a": 1,
"b": 1,
"max": 100
}
},
"responseAssertion": {
"luaAssertion": [
"function(method, url, requestBody, responseBody)",
" -- initialize assertion result",
" result = {}",
" -- verify valid json response",
" jsonResp=json.decode(responseBody);",
" if jsonResp == nil then",
" -- create new assertion result",
" local err = {}",
" -- used for metrics, should avoid duplicate values in the same assertion",
" err.id = 1",
" err.success = false",
" err.error = 'Failed to parse to json'",
" -- add to result",
" table.insert(result, err)",
" end",
" return result",
"end"
]
}
}
# "###;
# let result = serde_json::from_str::<Request>(req);
Expand Down
5 changes: 2 additions & 3 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting Started
## Start Test
The following request will send two `GET` request per second(`"countPerSec": 2`) to `httpbin.org/get` for 120
seconds(`"duration": 60`).
seconds(`"duration": 120`). More example can be found in [test cases](https://github.com/eipi1/overload/tree/main/tests/src/resources)
```shell
curl --location --request POST '{overload_host}:3030/test' \
--header 'Content-Type: application/json' \
Expand All @@ -20,7 +20,7 @@ Sample JSON request body -
"name": "demo-test",
"qps": {
"ConstantRate": {
"countPerSec": 1
"countPerSec": 2
}
},
"req": {
Expand All @@ -45,7 +45,6 @@ Sample JSON request body -
# assert!(result.is_ok());
```


It'll respond with a job identifier and status.
```json
{
Expand Down

0 comments on commit d4abf17

Please sign in to comment.