将 Jmeter 桌面应用程序用作 Web 应用程序 [英] Use Jmeter desktop application as web app
问题描述
我们知道 JMeter 是基于桌面的应用程序,它将在我们的操作系统中启动,我们可以用它来进行性能测试,但如果我想将它用作 Web 应用程序而不是桌面应用程序,该怎么办.
如何将 Jmeter 桌面应用程序用作 Web 应用程序并在某个端口上公开它?
我尝试关注,但没有人将 Jmeter 作为 webapp 启动.
- 使用 webswing、java web start 将 jmeter 桌面应用程序转换为 webapp,但没有成功.
- 直接在 rest 控制器中运行 jmeter jar 以将其作为 webapp 启动,但它没有作为 webapp 启动.
- 还尝试运行 jmeter docker 映像,但也无济于事.
谁能告诉我?我们是否有 jmeter 的 web 应用程序或 jmeter 的 web 版本,以便我可以将它用作 webapp 并通过某个端口从 web 浏览器访问它?像这样 localhost:8080/jmeter
目前将 JMeter 作为纯"工具运行Web 应用程序是不可能的,但是如果您需要做的只是通过 Web 界面/浏览器向您自己或其他人提供 JMeter GUI,您可以将 JMeter 安装到
更多信息:开始使用JMeter:安装&测试
As we know JMeter is desktop based application which will get launched in our OS and we can use it to do performance testing but what if I want to use it as web application rather than desktop application.
How can I use Jmeter desktop application as web app and expose this on some port ?
I tried following but none of them launched Jmeter as webapp.
- Converting the jmeter desktop application to webapp using webswing, java web start but was not successful in that.
- Running the jmeter jar directly in rest controller to launch it as webapp but it did not launch as webapp.
- Also tried to run the jmeter docker image but that also did not help.
Can anyone please tell me ? do we have web app of jmeter or web version of jmeter so that I can use it as webapp and access it from web browser via some port ? like this localhost:8080/jmeter
Currently running JMeter as a "pure" web application is not possible, however if all you need to do is to make JMeter GUI available to yourself or someone else via a web interface/browser you can install JMeter into a Docker container and expose the virtual desktop via i.e. noVNC so you (or someone else) will be able to open specific hostname/port in the browser and see JMeter GUI and create, edit or debug a script.
Example Dockerfile:
FROM uphy/novnc-alpine
RUN \
apk add --no-cache curl openjdk8-jre bash \
&& curl -L https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.1.tgz > /tmp/jmeter.tgz \
&& mkdir -p /opt \
&& tar -xvf /tmp/jmeter.tgz -C /opt \
&& rm /tmp/jmeter.tgz \
&& cd /etc/supervisor/conf.d \
&& echo '[program:jmeter]' >> supervisord.conf \
&& echo 'command=/opt/apache-jmeter-5.4.1/bin/./jmeter' >> supervisord.conf \
&& echo 'autorestart=true' >> supervisord.conf
So given you follow next steps:
Build the image:
docker build -t jmeter .
Run the image as the container:
docker run -it --rm -p 8080:8080 jmeter
Open
http://localhost:8080/vnc.html
URL in your browser (must be Websocket-capable)You will see a virtual desktop with JMeter
More information: Get Started With JMeter: Installation & Tests
这篇关于将 Jmeter 桌面应用程序用作 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!