I am a student and I have to do an experiment about software stress test.
I installed Android emulator on Ubuntu to simulate an Android equipment.
The experiment should be conductinig stress test on one or some applications.
At the same time, I need to obtain the memory variation of the Android emulator(especially free memory).
I am considering using awk of busybox to get information from /proc/meminfo of the Android in the adb shell.
But I failed to write a script to get these information periodically.For example, every 10 minutes.
Before this experiment, I wrote an script to measure the memory information of a Ubuntu system, like this
Code:
LOG_FILE="output of sysmon.csv"
echo "ElapsedTime,Buffers(kb),SwapCached(kb),SwapFree(kb),Mapped(kb),MemFree(kb)" > "$LOG_FILE"
ELAPSED_TIME=`date +%D:%H:%M:%S:%N` #hour, minute, second, nanu second
PERIOD=184 # seconds
while :
do
Buffers=`awk '/Buffers/ {print $2}' < "/proc/meminfo"`
SwapCached=`awk '/SwapCached/ {print $2}' < "/proc/meminfo"`
SwapFree=`awk '/SwapFree/ {print $2}' < "/proc/meminfo"`
Mapped=`awk '/Mapped/ {print $2}' < "/proc/meminfo"`
MemFree=`awk '/MemFree/ {print $2}' < "/proc/meminfo"`
echo "$ELAPSED_TIME,$Buffers,$SwapCached,$SwapFree,$Mapped,$MemFree" >> "$LOG_FILE"
sleep "$PERIOD"
ELAPSED_TIME=`date +%D:%H:%M:%S:%N`
done
Could you please give me any suggestion?
Thank you very much!