Saturday, March 19, 2011

Python XenBench Plotting GUI

After a little research I decided to look into the software I found and try and make a plotting GUI proof of concept. Matplotlib, the plotting library that I used, is described as follows:
Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in python scripts, the python and ipython shell (ala MATLAB or Mathematica), web application servers, and six graphical user interface toolkits.

The following steps need to be taken to install matplotlib:
  1. sudo apt-get install python-dev
  2. download numpy, which is the fundamental package needed for scientific computing with Python, here
  3. tar -xvf numpy-1.5.1.tar.gz
  4. sudo apt-get install gfortran
  5. cd numpy-1.5.1
  6. sudo python setup.py install
  7. sudo apt-get install python-matplotlib or get it here
The following steps should be taken to install general python GUI libraries:
  1. sudo apt-get install python-tk
  2. download pmw here
  3. tar -xvf Pmw.1.3.2.tar.gz
  4. cd Pmw.1.3.2
  5. cd src
  6. sudo python setup.py install
I created a tabbed pane view with tabs for the CPU, Cache and I/O section of our application, I added a menubar that can be used for certain actions (such as saving a certain graph, starting and stopping the real time monitoring, ...). I added a statusbar to the application as well, and I embedded a graph in the CPU pane. I got some inspiration from snippets of code that can be found here.



Note that Glade (which can be found here) could come in handy to design the GUI. Note also that I first tried to work with GNUPlot (using gnuplot-py), but the embedding of these graphs was not fully supported.

PS: Last week I made a little progress with the Curses interface for the CPU utilization monitoring, more on that later.

No comments:

Post a Comment