dcpus: display or cache UNIX system CPU stats

1 Cmd#1 on Machine HPMC7 User root
(ndxNo=1 Cmd# No=1 on Machine HPMC7 User root no_tm_u_h_cwd=3:35:35 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:35:35 root@HPMC7 /tmp # dcpus -info
display general info

2 Cmd#2 on Machine HPMC7 User root
(ndxNo=2 Cmd# No=2 on Machine HPMC7 User root no_tm_u_h_cwd=3:35:50 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:35:50 root@HPMC7 /tmp # cat /proc/stat
cat the stat from proc will display raw data and not easy to read on systems with multicores CPU

3 Cmd#3 on Machine HPMC7 User root
(ndxNo=3 Cmd# No=3 on Machine HPMC7 User root no_tm_u_h_cwd=3:35:58 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:35:58 root@HPMC7 /tmp # dcpus -iter 3 -delay 1 -prune 2,5
display the stat by iterating 3 times with a delay of 1 second in between and show only first 2 cores and last 5 cores

4 Cmd#4 on Machine HPMC7 User root
(ndxNo=4 Cmd# No=4 on Machine HPMC7 User root no_tm_u_h_cwd=3:36:10 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:36:10 root@HPMC7 /tmp # dcpus -iter 3 -delay 1 -transpose -prune 2,5 -stats user,system,idle
display the stat by iterating 3 times with a delay of 1 second in between and show only first 2 cores and last 5 cores.
Notice that this the same command as above but here we use -transpose to transpose the colomns and rows.

5 Cmd#5 on Machine HPMC7 User root
(ndxNo=5 Cmd# No=5 on Machine HPMC7 User root no_tm_u_h_cwd=3:36:22 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:36:22 root@HPMC7 /tmp # dcpus -iter 3 -delay 1 -prune 2,5 -stats user,system,idle
iterate 3 times but show only the stats of user,system,idle

6 Cmd#6 on Machine HPMC7 User root
(ndxNo=6 Cmd# No=6 on Machine HPMC7 User root no_tm_u_h_cwd=3:36:36 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:36:36 root@HPMC7 /tmp # dcpus -iter 3 -delay 1 -sortby user -transpose -stats system,user,irq,iowait -keeporder -NVU 5
iterate 3 times but show only the stats of system,user,irq,iowait and select only the 5 cores that has the highest 'user' consumption.
the -keeporder is to keep the listing in known stat order, and -NVU to specify the number of cores.
-sortby to give the importance to 'user' stat by sorting the CPUs on that attribute.

7 Cmd#7 on Machine HPMC7 User root
(ndxNo=7 Cmd# No=7 on Machine HPMC7 User root no_tm_u_h_cwd=3:36:52 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:36:52 root@HPMC7 /tmp # dcpus -iter 3 -delay 1 -sortby user -stats system,user,irq,iowait -keeporder -NVU 5
same as above without the transpose, this still fit properly on the terminal.

8 Cmd#8 on Machine HPMC7 User root
(ndxNo=8 Cmd# No=8 on Machine HPMC7 User root no_tm_u_h_cwd=3:37:0 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:37:0 root@HPMC7 /tmp # dcpus -iter 7 -delay 1 -prune 2,5 -cache
cache the data for a later replay by using the -cache option that will display the cache handle once the command is done executing

9 Cmd#9 on Machine HPMC7 User root
(ndxNo=9 Cmd# No=9 on Machine HPMC7 User root no_tm_u_h_cwd=3:37:12 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:37:12 root@HPMC7 /tmp # dcpus -iter 4 -delay 1 -prune 2,5 -replay 1718955424
replay the command from cached data.
simply specify the -replay following by the cache handle.

10 Cmd#10 on Machine HPMC7 User root
(ndxNo=10 Cmd# No=10 on Machine HPMC7 User root no_tm_u_h_cwd=3:38:16 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:38:16 root@HPMC7 /tmp # dcpus -iter 4 -delay 1 -sortby user -stats system,user,irq,iowait -keeporder -NVU 5 -replay 1718955424
when replaying the command from the cache you can use any options

11 Cmd#11 on Machine HPMC7 User root
(ndxNo=11 Cmd# No=11 on Machine HPMC7 User root no_tm_u_h_cwd=3:38:26 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:38:26 root@HPMC7 /tmp # dcpus -iter 4 -delay 0 -sortby user -stats system,user,irq,iowait -keeporder -NVU 5 -transpose -replay 1718955424
same replay as above but transpose

12 Cmd#12 on Machine HPMC7 User root
(ndxNo=12 Cmd# No=12 on Machine HPMC7 User root no_tm_u_h_cwd=3:41:0 root@HPMC7 /tmp u_h=root@HPMC7)
BASH 3:41:0 root@HPMC7 /tmp #
sweet!