简体   繁体   English

评估网络Java应用程序的性能

[英]Measuring performance for network Java application

We want to automatically measure performance of our Java product. 我们想要自动衡量我们Java产品的性能。

We want to have following metrics: 我们希望具有以下指标:

  • Processor loading 处理器加载
  • Memory loading 内存加载
  • Network loading 网络加载
  • Project related metrics 项目相关指标

We want to run those performance tests continuously on Jenkins server. 我们希望在Jenkins服务器上连续运行那些性能测试。 Project related performance metrics and system metrics above, will be displayed as some trend graphs. 以上与项目相关的性能指标和系统指标将显示为一些趋势图。

Could you please suggest a Java performance framework or maybe, approach, to measure system metrics automatically? 您能否提出一个Java性能框架或方法来自动测量系统指标?

I found a list of open source performance test tools and considering to use JMeter Java Sampler and running it from Java code. 我找到了一系列开放源代码性能测试工具,并考虑使用JMeter Java Sampler并从Java代码运行它。 But I am not familiar enough with JMeter and not sure that this is a proper choice. 但是我对JMeter不够熟悉,并且不确定这是否是正确的选择。

You will likely want to use some kind of JMX monitoring / profiling tool, such as VisualVM, https://visualvm.java.net/ . 您可能想要使用某种JMX监视/性能分析工具,例如VisualVM, https ://visualvm.java.net/。 It gives detailed processor load, memory load (split by JVM memory pool), and you can extend it to add your own metrics by writing custom MBeans in your code. 它提供了详细的处理器负载,内存负载(由JVM内存池划分),您可以通过在代码中编写自定义MBean对其进行扩展,以添加自己的指标。

I worked on building a monitoring webapp at a previous job - it periodically collected information from servers via JMX, and pinged that information to a Graphite instance so we could track the metrics over long time periods. 我在上一份工作中构建了一个监视Web应用程序-它通过JMX定期从服务器收集信息,并将该信息ping到Graphite实例,以便我们可以长时间跟踪指标。 You could consider doing a similar thing. 您可以考虑做类似的事情。 VisualVM is a good interim solution though. VisualVM是一个很好的临时解决方案。

JMeter is a good choice as it's free and open source, it can scale, it is Java-based and can be easily added as a task to CI process. JMeter是一个不错的选择,因为它是免费的开源软件,它可以扩展,基于Java,并且可以轻松地作为任务添加到CI流程中。

References: 参考文献:

  1. JMeter PerfMon Plugin - Servers Performance Monitoring reporting CPU, RAM, Network and Disk IO JMeter PerfMon插件 -服务器性能监控,报告CPU,RAM,网络和磁盘IO
  2. There is a JMeter Jenkins plugin providing native integration of JMeter tests into continuous build process 有一个JMeter Jenkins插件,可将JMeter测试本地集成到连续的构建过程中
  3. JMeter tests can be launched as OS command-line task, Ant task, Maven plugin, from Java code and you can use JMeter API to build and execute the test on the fly. JMeter测试可以通过Java代码以OS命令行任务,Ant任务,Maven插件的形式启动,您可以使用JMeter API即时构建和执行测试。 See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for details. 有关详细信息,请参见“ 不使用JMeter GUI的5种启动JMeter测试的方法”指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM