I found this older article how-to-monitor-the-computers-cpu-memory-and-disk-usage-in-java and wated to ask, if there is something new in java 7. I want to get the current CPU-, RAM- and netzwork-Usage of my App periodically. It has to work for linux (mac) and windows. The data must not be extremely detailed, 3 values would be enough (cpu: 10%, Ram 4%, Network 40%). Would be cool if the data is just for the app and not the whole os-system, however this would work, too.
Thank's for help
why cant you just use like bellow,
what is the difference???
Not much has changed since then unless it was done by another group. below are some of the significant changes that were included in Java 7 SE. Sadly none of them are what you are looking for.
http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html
javamelody i have used before it is pretty simple and I was able to get it running in a short amount of time https://code.google.com/p/javamelody/
http://demo.javamelody.cloudbees.net/monitoring
below is another alternative https://github.com/oshi/oshi
I would use the Metrics java library: http://metrics.codahale.com/
It comes with Sigar integration: https://github.com/cb372/metrics-sigar
answering my own question ;P some code i have written...
NetworkData:
CPU-Data:
RAM-Data:
PROCES-Data: