Hello All,
I have a shell script where with the lines below:
echo "${v_sd_dateTime},${RUN_QUEUE_SIZE},${LOAD_AVERAGE},${v_sd_load_list},${v_sd_thread_count_list}" >> ${v_sd_file}
Format of the output :
01/05/2005 08:00:00, RUN_QUEUE_SIZE, LOAD_AVG, CPU_PROD1, CPU_PROD2, THREADS_PROD1, THREADS_PR
Sample of the output :
01/07/2012 1:00 0 0.5 0.00% 0.50% 0.00% 74 29 69
prstat is used for the variables : ${v_sd_load_list}
, ${v_sd_thread_count_list}
The scripts is as below:
v_gap_prstat_line=`prstat -p ${v_gpsd_pid} 5 1 | grep -vi TOTAL | grep -v CPU`
CPU_LOAD_INSTANCE=` echo ${v_gap_prstat_line} | awk '{ print $9 }'`
THREAD_COUNT_INSTANCE=`echo ${v_gap_prstat_line} | awk '{ print $10 }' | cut -d/ -f2`
CPU_LOAD_INSTANCE_LIST="${CPU_LOAD_INSTANCE_LIST} ${CPU_LOAD_INSTANCE}"
THREAD_COUNT_INSTANCE_LIST="${THREAD_COUNT_INSTANCE_LIST} ${THREAD_COUNT_INSTANCE}"
v_sd_load_list=`echo ${CPU_LOAD_INSTANCE_LIST} | sed -e 's/^ *//' -e 's/ */,/g'`
v_sd_thread_count_list=`echo ${THREAD_COUNT_INSTANCE_LIST} | sed -e 's/^ *//' -e 's/ */,/g'`
**********************
I understand that prstat takes the option p
where it takes only the process id
5 being the number of times the statistics are repeated
1 being the interval in seconds
I have to migrate this in linux. I tried the command with
top -p 13213 -d 2 -n 1
But i dont get this output.
Could someone help.