如何在非GUI模式下在远程服务器上安装插件管理器和性能指标收集器?
How to install plugin manager and perfmon metric collector on remote server in Non- GUI mode?
我已经在一台远程 AWS 服务器上安装了 jmeter 5.2.1
。
我想收集响应和服务器信息的摘要报告以及性能指标。
我已经下载了 jmeter-plugins-manager-1.6.jar
和 jmeter-plugins-perfmon-2.1.jar
并复制到 /lib/ext
然后我在本地计算机上从 jmeter 创建了一个测试脚本并复制到服务器并尝试 运行 相同 jmeter -n -t AWS.jmx -l awsresults.jtl
但是我得到一个错误:
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/root/apache-jmeter-5.2.1/bin/AWS.jmx'.
Cause:
ClassNotFoundException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NoClassDefFoundError
cause-message : kg/apc/jmeter/vizualizers/CorrectedResultCollector
first-jmeter-class : org.apache.jmeter.save.SaveService$XStreamWrapper.realClass(SaveService.java:98)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.perfmon.PerfMonCollector
line number : 219
version : 5.2.1
当我在 jmeter 中的本地计算机上 运行 它按预期工作时。
有人可以帮助我理解和解决错误吗?
编辑:
`
2021-03-01 09:23:36,931 INFO k.a.j.p.PerfMonCollector: PerfMon metrics will be stored in /tmp/perfmon_7034792572732251249.jtl
2021-03-01 09:23:36,931 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[StandardJMeterEngine,5,main]
java.lang.NoClassDefFoundError: kg/apc/perfmon/metrics/MetricParams
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnector(PerfMonCollector.java:200) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnectors(PerfMonCollector.java:175) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(PerfMonCollector.java:126) ~[jmeter-plugins-perfmon-2.1.jar:?]
at org.apache.jmeter.reporters.ResultCollector.testStarted(ResultCollector.java:351) ~[ApacheJMeter_core.jar:5.2.1]
at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(CorrectedResultCollector.java:28) ~[jmeter-plugins-cmn-jmeter-0.4.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:206) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:381) ~[ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.ClassNotFoundException: kg.apc.perfmon.metrics.MetricParams
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_282]
... 8 more
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook started
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook ended
`
谢谢,
该错误意味着您没有在您的 AWS 实例上安装 PerfMon 插件,我认为当前版本的 JMeter 插件管理器无法 detect/install 在非 GUI 模式下缺少的插件所以您需要手动执行此操作。
类似于:
-
wget https://jmeter-plugins.org/get/ -O /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar
下载JMeter Plugins Command Line Runner
wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar -P /opt/apache-jmeter-5.2.1/lib/
安装JMeter Plugins Manager Command Line Utility:
java -cp /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
安装 PerfMon Plugin:
/opt/apache-jmeter-5.2.1/bin/./PluginsManagerCMD.sh install jpgc-perfmon
就是这样,现在您应该可以执行测试了
P.S。 According to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 or whatever its the current JMeter latest stable version
我已经在一台远程 AWS 服务器上安装了 jmeter 5.2.1
。
我想收集响应和服务器信息的摘要报告以及性能指标。
我已经下载了 jmeter-plugins-manager-1.6.jar
和 jmeter-plugins-perfmon-2.1.jar
并复制到 /lib/ext
然后我在本地计算机上从 jmeter 创建了一个测试脚本并复制到服务器并尝试 运行 相同 jmeter -n -t AWS.jmx -l awsresults.jtl
但是我得到一个错误:
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/root/apache-jmeter-5.2.1/bin/AWS.jmx'.
Cause:
ClassNotFoundException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NoClassDefFoundError
cause-message : kg/apc/jmeter/vizualizers/CorrectedResultCollector
first-jmeter-class : org.apache.jmeter.save.SaveService$XStreamWrapper.realClass(SaveService.java:98)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.perfmon.PerfMonCollector
line number : 219
version : 5.2.1
当我在 jmeter 中的本地计算机上 运行 它按预期工作时。
有人可以帮助我理解和解决错误吗?
编辑:
`
2021-03-01 09:23:36,931 INFO k.a.j.p.PerfMonCollector: PerfMon metrics will be stored in /tmp/perfmon_7034792572732251249.jtl
2021-03-01 09:23:36,931 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[StandardJMeterEngine,5,main]
java.lang.NoClassDefFoundError: kg/apc/perfmon/metrics/MetricParams
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnector(PerfMonCollector.java:200) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnectors(PerfMonCollector.java:175) ~[jmeter-plugins-perfmon-2.1.jar:?]
at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(PerfMonCollector.java:126) ~[jmeter-plugins-perfmon-2.1.jar:?]
at org.apache.jmeter.reporters.ResultCollector.testStarted(ResultCollector.java:351) ~[ApacheJMeter_core.jar:5.2.1]
at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(CorrectedResultCollector.java:28) ~[jmeter-plugins-cmn-jmeter-0.4.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:206) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:381) ~[ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.lang.ClassNotFoundException: kg.apc.perfmon.metrics.MetricParams
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_282]
... 8 more
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook started
2021-03-01 09:23:36,937 INFO o.a.j.r.ResultCollector: Shutdown hook ended
`
谢谢,
该错误意味着您没有在您的 AWS 实例上安装 PerfMon 插件,我认为当前版本的 JMeter 插件管理器无法 detect/install 在非 GUI 模式下缺少的插件所以您需要手动执行此操作。
类似于:
-
wget https://jmeter-plugins.org/get/ -O /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar
下载JMeter Plugins Command Line Runner
wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar -P /opt/apache-jmeter-5.2.1/lib/
安装JMeter Plugins Manager Command Line Utility:
java -cp /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
安装 PerfMon Plugin:
/opt/apache-jmeter-5.2.1/bin/./PluginsManagerCMD.sh install jpgc-perfmon
就是这样,现在您应该可以执行测试了
P.S。 According to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 or whatever its the current JMeter latest stable version