Performance Visualization with Gnuplot, continued

Thu 24 September 2009
  • 装备 tags:
  • foss
  • gnuplot
  • linux
  • shell
  • vmstat published: true comments: true

After I post my command to commandlinefu.com, there is an alternative command followed: (echo "set terminal png;plot '-' u 1:2 t 'cpu' w linespoints;"; sudo vmstat 2 10 | awk 'NR > 2 {print NR, $13}') | gnuplot > plot.png

This one is appreciated for using pipes and redirection. It works on Ubuntu Jaunty, on which, gnuplot doesn't provide a -e option. The author also showed an link to an open source project 'vmplot' on freshmeat. Vmplot is written in python, which combines parameters with scripts and end up with an os.system call. Grab the source from here. (Why use python instead on a simple bash command? because it's difficult to draw a multiplot without temp file or variables, you cannot read '-' twice.)

There are several people vote me down for my command! It must be primers whose use ubuntu and knows the world via Synaptic only, because they failed to run the command on their dated machine (*_*)