From 5aa23bf02f14e41f42d35513d5fee7dc37d2859e Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 22 Jan 2022 03:13:00 +0800 Subject: [PATCH] + benchmark --- .gitignore | 1 + tests/apis/benchmark.http.json | 42 ++++++++++++++++++++++++++ tests/flows/benchmark/pure.flow.json | 13 ++++++++ tests/flows/benchmark/script.flow.json | 13 ++++++++ 4 files changed, 69 insertions(+) create mode 100644 tests/apis/benchmark.http.json create mode 100644 tests/flows/benchmark/pure.flow.json create mode 100644 tests/flows/benchmark/script.flow.json diff --git a/.gitignore b/.gitignore index e21d81a6..2950829e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ dist ui ^ui/index.html tests/data/*/* +debug.log diff --git a/tests/apis/benchmark.http.json b/tests/apis/benchmark.http.json new file mode 100644 index 00000000..6f91acce --- /dev/null +++ b/tests/apis/benchmark.http.json @@ -0,0 +1,42 @@ +{ + "name": "用户接口", + "version": "1.0.0", + "description": "用户API", + "group": "benchmark", + "guard": "bearer-jwt", + "paths": [ + { + "path": "/ping", + "method": "GET", + "guard": "-", + "process": "xiang.helper.Return", + "in": [":query"], + "out": { + "status": 200, + "type": "application/json" + } + }, + { + "path": "/flows/pure", + "method": "GET", + "guard": "-", + "process": "flows.benchmark.pure", + "in": [], + "out": { + "status": 200, + "type": "application/json" + } + }, + { + "path": "/flows/script", + "method": "GET", + "guard": "-", + "process": "flows.benchmark.script", + "in": [], + "out": { + "status": 200, + "type": "application/json" + } + } + ] +} diff --git a/tests/flows/benchmark/pure.flow.json b/tests/flows/benchmark/pure.flow.json new file mode 100644 index 00000000..bf744b95 --- /dev/null +++ b/tests/flows/benchmark/pure.flow.json @@ -0,0 +1,13 @@ +{ + "label": "性能测试", + "version": "1.0.0", + "description": "性能测试", + "nodes": [ + { + "name": "性能测试", + "process": "xiang.helper.Return", + "args": [1, 2, 3] + } + ], + "output": "{{$res.性能测试}}" +} diff --git a/tests/flows/benchmark/script.flow.json b/tests/flows/benchmark/script.flow.json new file mode 100644 index 00000000..e98c5c6f --- /dev/null +++ b/tests/flows/benchmark/script.flow.json @@ -0,0 +1,13 @@ +{ + "label": "性能测试", + "version": "1.0.0", + "description": "性能测试", + "nodes": [ + { + "name": "性能测试", + "process": "scripts.time.now", + "args": [1, 2, 3] + } + ], + "output": "{{$res.性能测试}}" +}