Skip to content

Commit 447fa0a

Browse files
author
Qi Li (leeli4)
committed
unified time
1 parent a2ae9a3 commit 447fa0a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

collect.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ do
4949

5050
while true; do
5151
if [ -f "$SIGNAL_FILE" ]; then
52-
Data=$(cat $SIGNAL_FILE 2>/dev/null || echo 12345678999999 )
52+
# Data=$(cat $SIGNAL_FILE 2>/dev/null || echo 12345678999999 )
53+
Data=$(awk 'NR==1' $SIGNAL_FILE 2>/dev/null || echo 12345678999999)
5354
if [[ $Data -eq $i ]]; then
5455
break
5556
log_verbose "Start signal received. Beginning data collection for PID $SCRIPT_NAME..."
@@ -80,7 +81,7 @@ do
8081
#echo $PID" "$SCRIPT_NAME" "$PYTHON_SWITCH" "$OUTPUT_FILE
8182
ALO_TOTAL=$(cat /proc/meminfo | grep 'Committed_AS' | awk -F' ' '{print $2}')
8283
Limit=$(cat /proc/meminfo | grep 'CommitLimit' | awk -F' ' '{print $2}')
83-
TIME=$(date +%T)
84+
TIME=$(awk 'NR==2' $SIGNAL_FILE 2>/dev/null || echo 12345678999999)
8485
if [ ! -z "$PID" ]; then
8586
log_verbose "Monitoring PID: $PID"
8687
ALO_PID=$(pmap -d $PID | grep "writeable/private" | awk -F' ' '{print $4}' | egrep -o '[0-9.]+' )

plot.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ do
133133

134134
sleep 0.1
135135
# Signal all processes to start collecting
136+
TIME=$(date +%T)
136137
echo $i > $SIGNAL_FILE
138+
echo $TIME >> $SIGNAL_FILE
137139

138140
while [[ $(ps -aux | grep "collect.sh" | wc -l) -gt $(($(ls "/tmp/signalback/" | grep "nso_collect_start_signalback_.*_$i" | wc -l)+1)) ]]; do
139141
sleep 0.1
@@ -194,4 +196,4 @@ echo "===================================== Ploting graph for python3 processes
194196
echo "====================================== Ploting graph to compare between process ========================================================"
195197
bash graphs_compare.sh $VERBOSE
196198
echo -e "====================================== Ploting graph to compare between process done ========================================================\n"
197-
echo "===================================== Ploting graph to all process done ================================================="
199+
echo "===================================== Ploting graph to all process done ================================================="

0 commit comments

Comments
 (0)