Last active
September 20, 2015 02:01
-
-
Save ikuwow/9ba6c94129770389bd58 to your computer and use it in GitHub Desktop.
簡便なSafariとChromeのメモリ使用量の測定方法 ref: http://qiita.com/ikuwow/items/976166b30610f33f4643
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sh safari_vs_chrome.sh & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tail -f safari_vs_chrome.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-04-05 11:04:14 926424 874976 | |
2015-04-05 11:04:15 926372 874972 | |
2015-04-05 11:04:17 926380 874952 | |
2015-04-05 11:04:18 926412 874952 | |
2015-04-05 11:04:19 926456 874952 | |
Date Safari Chrome | |
2015-04-05 11:04:20 926536 874952 | |
2015-04-05 11:04:21 926484 874944 | |
2015-04-05 11:04:22 926628 874960 | |
(以下続く) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
logfile="./safari_vs_chrome.log" | |
while sleep 1; do | |
now=`date +%S` | |
surplus=`expr $now % 10` | |
if [ $surplus -eq 0 ];then | |
echo 'Date Safari Chrome' > $logfile | |
fi | |
echo `date "+%Y-%m-%d %H:%M:%S"` \ | |
`ps aux | grep Safari | awk '{sum += \$6}END{print sum}'` \ | |
`ps aux | grep Chrome | awk '{sum += \$6}END{print sum}'` > $logfile | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment