diff --git a/webmeter/core/engine.py b/webmeter/core/engine.py index 7bc6eaa..5c39aaa 100644 --- a/webmeter/core/engine.py +++ b/webmeter/core/engine.py @@ -34,6 +34,10 @@ def write_JmeterFile(cls, file, content) -> None: file_path = os.path.join(cls.JMETER_DIR, 'bin', file) Common.write_file_content(file_path, content) + @classmethod + def remote_hosts(cls): + pass + @classmethod def run(cls, content: dict, remote=False) -> int: diff --git a/webmeter/core/utils.py b/webmeter/core/utils.py index ccbfd35..5261740 100644 --- a/webmeter/core/utils.py +++ b/webmeter/core/utils.py @@ -3,6 +3,7 @@ from enum import Enum, unique import platform import psutil +import time from loguru import logger from xml.etree import ElementTree from typing import Optional diff --git a/webmeter/static/js/lan.js b/webmeter/static/js/lan.js index 22e6746..785b550 100644 --- a/webmeter/static/js/lan.js +++ b/webmeter/static/js/lan.js @@ -56,6 +56,25 @@ const ENGLISH = { 'browser_compatible_headers': 'Browser-compatible headers', 'parameters': 'Parameters', 'body_data': 'Body Data', + 'task':'Task', + 'plan':'Plan', + 'model':'Model', + 'threads':'Threads', + 'success_num':'Success Num', + 'fail_num':'Fail Num', + 'status':'Status', + 'start_time':'Start Time', + 'end_time':'End Time', + 'jmeter_config': 'JMETER CONFIG', + 'dashboard': 'Dashboard', + 'charts':'Charts', + 'test_and_report_info': 'Test and Report information', + 'requests_summary':'Requests Summary', + 'statistics':'Statistics', + 'response_times_over_time':'Response Times Over Time (ms)', + 'latencies_over_time': 'Latencies Over Time (ms)', + 'connect_time_over_time':'Connect Time Over Time (ms)', + 'screenshot':'ScreenShot' } @@ -117,4 +136,23 @@ const CHINESE = { 'browser_compatible_headers': '与浏览器兼容的头', 'parameters': '参数', 'body_data': '消息体数据', + 'task':'任务', + 'plan':'测试计划', + 'model':'模式', + 'threads':'线程数', + 'success_num':'成功数', + 'fail_num':'失败数', + 'status':'状态', + 'start_time':'开始时间', + 'end_time':'结束时间', + 'jmeter_config': 'JMETER配置文件', + 'dashboard': '汇总', + 'charts':'图表', + 'test_and_report_info': '测试和报告数据信息', + 'requests_summary':'请求详细', + 'statistics':'统计', + 'response_times_over_time':'响应时间(毫秒)', + 'latencies_over_time': '延迟时间(毫秒)', + 'connect_time_over_time':'连接时间(毫秒)', + 'screenshot':'截图' } \ No newline at end of file diff --git a/webmeter/templates/analysis.html b/webmeter/templates/analysis.html index 689c058..00c95c5 100644 --- a/webmeter/templates/analysis.html +++ b/webmeter/templates/analysis.html @@ -110,7 +110,7 @@

- ScreenShot +
@@ -120,10 +120,10 @@

- +
-

Test and Report information

+

@@ -151,7 +151,7 @@

Test and Report information

-

Requests Summary

+

@@ -188,7 +188,7 @@

Requests Summary

-

Statistics

+

@@ -232,10 +232,10 @@

Statistics

- +
-
Response Times Over Time (ms)
+
-
Latencies Over Time (ms)
+
-
Connect Time Over Time (ms)
+
diff --git a/webmeter/templates/config.html b/webmeter/templates/config.html index b26f7bc..eb951c2 100644 --- a/webmeter/templates/config.html +++ b/webmeter/templates/config.html @@ -90,29 +90,32 @@

- JMETER CONFIG +
+ {% if platform == 'windows' %}
-
- - -
-
- - -
+ {% else %} +
+ + +
+ {% endif %} +
+ + +
diff --git a/webmeter/templates/result.html b/webmeter/templates/result.html index 967fa0d..87910bb 100644 --- a/webmeter/templates/result.html +++ b/webmeter/templates/result.html @@ -88,12 +88,12 @@

- TASK +

@@ -101,15 +101,15 @@

- - - - - - - - - + + + + + + + + + diff --git a/webmeter/view/page.py b/webmeter/view/page.py index 59abf9d..9541db0 100644 --- a/webmeter/view/page.py +++ b/webmeter/view/page.py @@ -4,6 +4,7 @@ from fastapi.responses import RedirectResponse from fastapi import APIRouter import os +from core.utils import Common router = APIRouter() @@ -29,4 +30,5 @@ async def result(request: Request, plan: str, task: str): @router.get("/config", response_class=HTMLResponse) async def result(request: Request): - return templates.TemplateResponse("config.html", {"request": request}) \ No newline at end of file + platform = Common.pc_platform() + return templates.TemplateResponse("config.html", {"request": request, 'platform': platform}) \ No newline at end of file diff --git a/webmeter/webmeter/app.db b/webmeter/webmeter/app.db new file mode 100644 index 0000000..470f35d Binary files /dev/null and b/webmeter/webmeter/app.db differ diff --git a/webmeter/webmeter/plan01/plan.jmx b/webmeter/webmeter/plan01/plan.jmx new file mode 100644 index 0000000..defd584 --- /dev/null +++ b/webmeter/webmeter/plan01/plan.jmx @@ -0,0 +1,52 @@ + + + + + false + false + true + + + + + + + + Thread Group Comment + continue + + false + 1 + + 500 + 1 + false + + + true + + + + + + + www.baidu.com + + https + + /?tn=02003390_42_hao_pg + GET + true + false + true + false + + + + HTTP Request Comment + + + + + + \ No newline at end of file
PLANTASKMODELTHREADSSUCCESS NUMFAILED NUMSTATUSSTART TIMEEND TIME