Best tool to record CPU and memory usage with Grinder?

笑着哭i 提交于 2019-12-07 23:12:05

问题


I am using grinder in order to generate reports for the performance tests for my application. But I noticed that it does not generate any report on CPU and memory usage. On further investigation, I found that Grinder does not provide this information. Now, my question is, is there any tool that can be hooked up with grinder, to record the CPU and memory usage details?


回答1:


As you have discovered, this is not supported directly in The Grinder itself. You will need to use a collection of tools to accomplish this.

I use a combination of Quickstatd, Graphite, and Grinder to Graphite to get all my results in the same place where I can see them. If you need to support Windows, you can probably use collectd (with ssc-serv and the Graphite plugin) instead of Quickstatd, which is based on bash scripts.

You can also pull in server side metrics (like DB lookups per second, etc.) with tools like jmxtrans, statsd, and metrics.

Having all that information in the same place is really powerful, and can give you some good insights.




回答2:


If you grind a Java server, you can get data via JMX from OperatingSystemMXBean and MemoryMXBean.

Then add the data to a Grinder user Statistic and the data will end up in the -data.log

grinder.statistics.registerDataLogExpression("Load", "userDouble0")

..

grinder.statistics.forCurrentTest.setDouble("userDouble0", systemLoadAverage)

the -data.log can directly be fed into Gnuplot

gnuplot> plot 'client-0-data.log' using 2:7 title "System Load"


来源:https://stackoverflow.com/questions/18919541/best-tool-to-record-cpu-and-memory-usage-with-grinder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!