Eu preciso criar um gráfico de linhas para exibir o uso da CPU de cada processo ao longo do tempo. Como faço para criar o gráfico com o tempo como o eixo X,% de CPU como o eixo Y, então use o nome do comando para indicar em qual linha do gráfico os dados pertencem?
Meus dados foram criados usando o comando unix:
pidstat -hdul 1 > file.txt
Eu então reformatou os dados em csv usando este comando:
sed '1d;/^[#]/d;/^$/d;s/^[ ]*//;s/[ ]+/,/g' raw_data_file_input > nice_data_file.csv
Meus dados são organizados nas seguintes colunas:
Time, PID, %usr, %system, %guest, %CPU, CPU, KB_rd/s, KB_wr/s, KB_ccwr/s, Command
Em outras palavras, eu quero que cada comando "kjournald" seja uma linha no gráfico em vários momentos, e "gnome-panel" seja outra linha separada.
Aqui está um exemplo dos dados no formato csv:
1320713878,680,0.00,0.00,0.00,0.00,0,0.00,35.64,0.00,kjournald
1320713878,2831,1.98,1.98,0.00,3.96,0,0.00,0.00,0.00,/usr/bin/X,:0,-br,-verbose,-auth,/var/run/gdm/auth-for-gdm-LiEP18/database,-nolisten,tcp,vt7,
1320713878,4360,0.00,1.98,0.00,1.98,0,0.00,0.00,0.00,gnome-terminal,
1320713878,7897,1.98,0.00,0.00,1.98,0,0.00,0.00,0.00,gnome-panel,
1320713878,24834,0.00,0.99,0.00,0.99,0,0.00,0.00,0.00,networking,networking,file:///usr/local/src/opensplice/install/HDE/x86.linux2.6/etc/config/ospl.xml,
1320713878,24986,0.00,1.98,0.00,1.98,1,0.00,0.00,0.00,pidstat,-hdul,1,
1320713879,2426,1.00,1.00,0.00,2.00,3,0.00,0.00,0.00,/usr/bin/prltoolsd,-p,/var/run/prltoolsd.pid,
1320713879,2831,2.00,1.00,0.00,3.00,2,0.00,4.00,0.00,/usr/bin/X,:0,-br,-verbose,-auth,/var/run/gdm/auth-for-gdm-LiEP18/database,-nolisten,tcp,vt7,
1320713879,7904,14.00,0.00,0.00,14.00,1,0.00,0.00,0.00,nautilus,--no-desktop,--browser,
1320713879,24834,0.00,1.00,0.00,1.00,0,0.00,0.00,0.00,networking,networking,file:///usr/local/src/opensplice/install/HDE/x86.linux2.6/etc/config/ospl.xml,
1320713879,24992,0.00,2.00,0.00,2.00,0,0.00,0.00,0.00,/bin/sh,./killAll.sh,
1320713880,2831,0.00,1.00,0.00,1.00,1,0.00,0.00,0.00,/usr/bin/X,:0,-br,-verbose,-auth,/var/run/gdm/auth-for-gdm-LiEP18/database,-nolisten,tcp,vt7,
1320713880,3466,0.00,1.00,0.00,1.00,2,0.00,0.00,0.00,/usr/sbin/nscd,
1320713880,4129,0.00,2.00,0.00,2.00,0,0.00,0.00,0.00,/usr/bin/prl_wmouse_d,-d,
1320713880,24986,0.00,2.00,0.00,2.00,2,0.00,0.00,0.00,pidstat,-hdul,1,
1320713880,24992,0.00,2.00,0.00,2.00,3,0.00,0.00,0.00,/bin/sh,./killAll.sh,