Skip to content

Commit

Permalink
Memory on host
Browse files Browse the repository at this point in the history
  • Loading branch information
viveksanagari committed Jul 5, 2018
1 parent 85e0279 commit a2ac136
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions memory_host
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

free | awk 'NR==2 {print (($2-($4+$6))/$2)*100}' > mem.txt
sleep 1s

for value in {2..60}
do
free | awk 'NR==2 {print (($2-($4+$6))/$2)*100}' >> mem.txt
sleep 1s
done

awk '{sum+=$1;} END {print sum/60}' mem.txt

0 comments on commit a2ac136

Please sign in to comment.