Archive

Posts Tagged ‘async’

JavaFX – System Monitor

June 26, 2009 6 comments

My previous post on LineChart uses simulated CPU usage data. Just thought of updating that to show live CPU and Memory information.

A tribute to all    users

For Applet mode, click on above image

For standalone mode

One of the way to implement this is to use some existing command line utilities. I used – top – command to get the CPU and Memory usage information. Execute top using ProcessBuilder, get the Process instance. Get the output stream from process and read the output of top command. Now parse this content (a bit tricky, each version had its own output format) to get the information.

Note: The implementation is not concrete (as it relies on simple text parsing), may not work on some platforms or locales due to difference in output of top command. It will not work on platforms which does not support top command.

Try it out and let me know feedback


var dzone_url = “http://blogs.sun.com/rakeshmenonp/entry/javafx_system_monitor”;
var dzone_style = ‘2’;

Advertisements
Categories: javafx Tags: , , ,