JFXStudio: sketch, hack, share

JavaFX client for “top”

Posted by: Rakesh Menon on: June 29, 2009

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 CPU and Memory information. Plot the chart using JavaFX chart APIs.

For Applet mode, click on above image

For standalone mode

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.

Source available here

Leave a Reply

Challenge: Small is the New Big

This month's challenge: code something cool in only 30 lines, using the theme of Five

Tags

Archives