想發佈這個,因爲我搜索了很多,並找不到解決方案。Jmeter PerfMon指標收集在不同的jmx端口
使用jmeter和ServerAgent(2.2.1),我很難讓它在定製的JMX端口(不是4711)上工作。每的文檔,你需要指定,像這樣的參數:
By default the Server Agent will try to connect to JMX server at localhost with port 4711. If you started JMX server at different host/port or using authentication with username/password, please, use following additional parameters:
url=<hostname>\:<port>
user=<username>
password=<password>
Available JMX metric types:
gc-time - time spent in garbage collection, milliseconds (used method)
memory-usage - heap memory used by VM, bytes (method used)
memory-committed - heap memory committed by VM, bytes (method used)
memorypool-usage - heap memory pool usage, bytes (method used)
memorypool-committed - heap memory pool committed size, bytes (method used)
class-count - loaded class count in VM (used method)
compile-time - time spent in compilation, milliseconds (used method)
Examples:
gc-time - monitor GC time at localhost:4711
memory-usage:url=somehost.com\:4715 - use alternative hostname/password
class-count:url=somehost.com\:4715:user=apc:password=SecurityPlease123 - some secure setup access
所以,我想,使用
本地主機4444 JMX GC-時間:URL =本地主機:9080
這但導致服務器代理具有以下堆棧跟蹤
INFO 2017-02-23 20:53:51.352 [kg.apc.p](): Starting measures: jmx:gc-time:url=localhost\:9080
ERROR 2017-02-23 20:53:51.445 [kg.apc.p](): Failed to get MX Bean data provider
java.lang.IllegalArgumentException: Can't define JMX type
at kg.apc.perfmon.metrics.jmx.AbstractJMXDataProvider.getProvider(AbstractJMXDataProvider.java:48)
at kg.apc.perfmon.metrics.JMXMetric.<init>(JMXMetric.java:42)
at kg.apc.perfmon.metrics.AbstractPerfMonMetric.createMetric(AbstractPerfMonMetric.java:65)
at kg.apc.perfmon.PerfMonMetricGetter.setUpMetrics(PerfMonMetricGetter.java:138)
at kg.apc.perfmon.PerfMonMetricGetter.processCommand(PerfMonMetricGetter.java:63)
at kg.apc.perfmon.PerfMonMetricGetter.processNextCommand(PerfMonMetricGetter.java:101)
at kg.apc.perfmon.PerfMonWorker.read(PerfMonWorker.java:210)
at kg.apc.perfmon.PerfMonWorker.processCommands(PerfMonWorker.java:97)
at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:175)
ERROR 2017-02-23 20:53:51.446 [kg.apc.p](): Invalid metric specified: jmx
java.lang.RuntimeException: Failed to get MX Bean data provider
at kg.apc.perfmon.metrics.JMXMetric.<init>(JMXMetric.java:45)
at kg.apc.perfmon.metrics.AbstractPerfMonMetric.createMetric(AbstractPerfMonMetric.java:65)
at kg.apc.perfmon.PerfMonMetricGetter.setUpMetrics(PerfMonMetricGetter.java:138)
at kg.apc.perfmon.PerfMonMetricGetter.processCommand(PerfMonMetricGetter.java:63)
at kg.apc.perfmon.PerfMonMetricGetter.processNextCommand(PerfMonMetricGetter.java:101)
at kg.apc.perfmon.PerfMonWorker.read(PerfMonWorker.java:210)
at kg.apc.perfmon.PerfMonWorker.processCommands(PerfMonWorker.java:97)
at kg.apc.perfmon.AgentTool.processParams(AgentTool.java:72)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:63)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:175)
Caused by: java.lang.IllegalArgumentException: Can't define JMX type
at kg.apc.perfmon.metrics.jmx.AbstractJMXDataProvider.getProvider(AbstractJMXDataProvider.java:48)
at kg.apc.perfmon.metrics.JMXMetric.<init>(JMXMetric.java:42)
... 14 more
這個解決方案令人難以置信的是將url部分放在第一位。希望有人發現這個頁面和時間可以保存。
例如
URL =本地主機:9080:GC-時間
Madhu,感謝您的回覆,但是如果您閱讀完整的內容,我會在我的問題中發佈答案,作爲可能會有同樣問題的人員的參考 – joecoder