开发者

Java: measuring performance of an application by upgrading it to a web service

I have an application that's behaving as a server in a way. I have some consumers (another application) which send tasks to the "server" application and get something as a result. The application is implemented in Java as a开发者_如何学Go console application. The problem is that I need to measure the performance of the application (CPU, memory, throughput if possible and anything else I could get). If I keep my "server" as a console application, I get a problem of application level measuring, which can be extremely hard. My idea was to "upgrade" the console application to a web service, i.e., to create some kind of a wrapper so to be able to call the "server" as a web application. I guess that the monitoring part would be much easier then.

I'd like to hear your thoughts about it. Is that a good idea? Can I get better results if I upgrade it to a web service? And how do I even do that? At this point I just want to get some results, the code can be dirty. The application is originally imagined as a web service (or something similar), the console application is just a simulation, so creating a web service instead of a console application is not a terrible thing to do.


Maybe you can use JMX protocol and JConsole to connect to your application. With JConsole you will have detailed information about memory usage, CPU usage, threads etc. It will also allow you to control your application on the fly by means of MBean.

Take a look at: http://download.oracle.com/javase/1.5.0/docs/guide/management/jconsole.html


Yes its a good idea to make your application a Web Service. It will make your application secure and scalable out of the box.

You can chose yourself that which web service you want to apply. I would suggest you to go for RestFul web service (JAX-RS). And you can use sl4j for logging all the information about the mem and cpu usage.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜