I have this question which give me a file.tar.gz which include a calculator file and want to extract and run it
in the output it wants to show
1)cpu avg usage
2)total time taken to run
3)memory and I/O usage
can anyone help???
memusage=$(memusage=$(/usr/bin/free | grep Mem | awk '{print $3/$2 * 100.0 "%"}' | cut -d "%" -f1);echo "$(printf "%0.0f\n" $memusage)") && echo Memory Usage is $memusage
root@Client1:~# free -m total used free shared buffers cached Mem: 927 799 128 0 15 754 -/+ buffers/cache: 28 898 Swap: 99 0 99
/bin/grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}' /usr/bin/free | grep Mem | awk '{print $3/$2 * 100.0 "%"}'
Sync Total: 1 directory, 4 files, 0 symlinks --------------------------------- Host Name: host name here --------------------------------- Group Name: group name here --------------------------------- Disk Usage: 37% --------------------------------- CPU Usage: 78% --------------------------------- Memory Usage: 11% --------------------------------- Temperatu 44.9'C --------------------------------- Local IP: 192.168.0.115 --------------------------------- Public IP: public ip here --------------------------------- Tunnel Port: 5001 --------------------------------- Tunnel Status: Fri Mar 6 06:23:00 EET 2015 opening reverse tunnel from my_host_he 5001 to 127.0.0.1:22 ---------------------------------