Мне нужно создать линейную диаграмму для отображения использования процессора каждым процессом с течением времени. Как создать диаграмму со временем в качестве оси X,% ЦП в качестве оси Y, а затем использовать имя команды, чтобы указать, к какой строке на диаграмме относятся данные?
Мои данные были созданы с помощью команды unix:
pidstat -hdul 1> file.txt
Затем я переформатировал данные в CSV с помощью этой команды:
sed '1d;/^ [#]/d;/^ $/d; s/^ [] *//; s/[]+/,/g' raw_data_file_input> nice_data_file.csv
Мои данные организованы в следующие столбцы:
Время, PID,% usr,% system,% guest,% CPU, CPU, KB_rd/s, KB_wr/s, KB_ccwr/s, команда
Другими словами, я хочу, чтобы каждая команда "kjournald" была одной строкой на графике в разное время, а "gnome-panel" - другой отдельной строкой.
Вот пример данных в формате 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,