• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically monitor the performance

 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need to write a java program which should dynamically monitor the performance (cpu, memory, network bandwidth, load) and ability to tune.

Any idea & Suggestions ?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not possible to do in pure Java, because the API lacks access to this kind of system information. The best you can do is call system tools (like ps and top on Unix) via Runtime.exec, and evaluate and display their output in your Java app.

What exactly do you mean by "ability to tune" ?
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 1.5 API has access to that kind of information through the new Monitoring and Management API.
Have a look at what's possible in this article: Using JConsole to Monitor Applications
[ September 22, 2005: Message edited by: Joe Ess ]
 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all
I have gone through Joe Ess link. I think it speaks about Monitoring and Management of JVM .But I don have JVM .I�m going to make an ext by using GCJ compiles (compiler to native code)


This is exactly what i need.

I have a simple SWT Dialog box which shows the status of Uploading file to SCP Server. (Through network)
I need to have two sliders...
First one will show the CUP usage so i can scroll the slider and set the cup usage dynamically.

Second one is same as first one buy for network bandwidth

I think it should answer to Dittmer's question

Thanks
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the Management and Monitoring API is for monitoring the performance of a JVM. If you are lucky enough to use a user-friendly operating system like Linux, the information you seek is easily accessible as text files in the proc filesystem. If you are using Windows, start reading about JNI and the win32 API.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!