projects
/
p2p-testing-infrastructure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
207c98b
)
swift client integration update -- *.log.mon file generation; *.log.data file generat...
author
P2P-Next User
<p2p@p2p-next-04-201.grid.pub.ro>
Wed, 24 Nov 2010 10:42:01 +0000
(12:42 +0200)
committer
P2P-Next User
<p2p@p2p-next-04-201.grid.pub.ro>
Wed, 24 Nov 2010 10:42:01 +0000
(12:42 +0200)
ControlScripts/client_script_mappings
patch
|
blob
|
history
ControlScripts/clients/swift/start_swift_leecher.sh
patch
|
blob
|
history
ControlScripts/hook_monitor_pid.sh
patch
|
blob
|
history
ControlScripts/schedule_client.sh
patch
|
blob
|
history
diff --git
a/ControlScripts/client_script_mappings
b/ControlScripts/client_script_mappings
index
e483efd
..
ffd19ec
100644
(file)
--- a/
ControlScripts/client_script_mappings
+++ b/
ControlScripts/client_script_mappings
@@
-190,5
+190,8
@@
parse_client_log()
"tribler_proxy_04")
clients/tribler/parse_tribler.sh ${log_folder} ${log_file}
;;
"tribler_proxy_04")
clients/tribler/parse_tribler.sh ${log_folder} ${log_file}
;;
+ "swift_seeder" | "swift_leecher")
+ clients/swift/parse_swift.sh ${log_folder} ${log_file}
+ ;;
esac
}
esac
}
diff --git
a/ControlScripts/clients/swift/start_swift_leecher.sh
b/ControlScripts/clients/swift/start_swift_leecher.sh
index
3fd34fe
..
e3e723a
100755
(executable)
--- a/
ControlScripts/clients/swift/start_swift_leecher.sh
+++ b/
ControlScripts/clients/swift/start_swift_leecher.sh
@@
-36,4
+36,12
@@
cd $SWIFT_ABS_PATH
echo ./swift -h "$HASH" -t "${TRACKER_IP}:6881" -p > ~/deb
./swift -h "$HASH" -t "${TRACKER_IP}:6881" -p
echo ./swift -h "$HASH" -t "${TRACKER_IP}:6881" -p > ~/deb
./swift -h "$HASH" -t "${TRACKER_IP}:6881" -p
+#
+#./swift -h "$HASH" -t "${TRACKER_IP}:6881" -p &
+# ps -ef | grep shedule bla bla # proper way of determining PID of schedule (master) process
+# kill -USR1 $SCHEDULE_PID # SCHEDULE_PID is pid for master process
+#
+# wait # wait for client process to complete
+#
+
rm -f ${HASH}*
rm -f ${HASH}*
diff --git
a/ControlScripts/hook_monitor_pid.sh
b/ControlScripts/hook_monitor_pid.sh
index
7bff3c6
..
b336789
100755
(executable)
--- a/
ControlScripts/hook_monitor_pid.sh
+++ b/
ControlScripts/hook_monitor_pid.sh
@@
-18,6
+18,7
@@
pid=$1
kill -0 $pid > /dev/null 2>&1
if test $? -ne 0; then
echo -e "PID $pid does not exists.\nUsage: $0 <pid>" 1>&2
kill -0 $pid > /dev/null 2>&1
if test $? -ne 0; then
echo -e "PID $pid does not exists.\nUsage: $0 <pid>" 1>&2
+ ps -ef
exit 1
fi
exit 1
fi
diff --git
a/ControlScripts/schedule_client.sh
b/ControlScripts/schedule_client.sh
index
42d78a0
..
0bf2078
100755
(executable)
--- a/
ControlScripts/schedule_client.sh
+++ b/
ControlScripts/schedule_client.sh
@@
-79,6
+79,15
@@
test_infinite()
fi
}
fi
}
+cleanup()
+{
+ stop_client ${CLIENT_TYPE}
+ kill ${mon_pid}
+}
+
+# use cleanup function when receiving signals
+trap cleanup 0 1 2 3 15
+
parse_periods
DEBUG echo "start_time is ${start_time}"
parse_periods
DEBUG echo "start_time is ${start_time}"
@@
-96,8
+105,25
@@
DEBUG echo "CLIENT_TYPE is ${CLIENT_TYPE}"
start_client ${CLIENT_TYPE} ${DL_BW} ${UL_BW} ${NO_CONNECTIONS}
background_pid=$!
DEBUG echo "background_pid is ${background_pid}"
start_client ${CLIENT_TYPE} ${DL_BW} ${UL_BW} ${NO_CONNECTIONS}
background_pid=$!
DEBUG echo "background_pid is ${background_pid}"
+
+# wait_for_usr1()
+# {
+# # do nothing, successfully
+# }
+#
+# trap wait_for_usr1 10 # wait_for_usr1 is simple handler (waits for SIGUSR1 from start_client process)
+#
+
+sleep 5
+client_pid=$(pgrep -P ${background_pid})
+DEBUG echo "client_pid is ${client_pid}"
old_time=${start_time}
old_time=${start_time}
+# Monitor client's resources
+echo "$client_pid"
+./hook_monitor_pid.sh "$client_pid" >> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/$(hostname).log.mon 2>&1 &
+mon_pid=$!
+
for ((i = 0; i < ${#suspend_resume[@]}; i += 2)); do
# Sleeping while the client runs. When i wake up i will suspend the client
test_infinite ${suspend_resume[$i]}
for ((i = 0; i < ${#suspend_resume[@]}; i += 2)); do
# Sleeping while the client runs. When i wake up i will suspend the client
test_infinite ${suspend_resume[$i]}
@@
-108,10
+134,7
@@
for ((i = 0; i < ${#suspend_resume[@]}; i += 2)); do
DEBUG echo "client_pid is ${client_pid}"
suspend_client ${client_pid}
old_time=${suspend_resume[$i]}
DEBUG echo "client_pid is ${client_pid}"
suspend_client ${client_pid}
old_time=${suspend_resume[$i]}
-
- # Monitor client's resources
- ./hook_monitor_pid $client_pid >> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log.mon 2>&1 &
-
+
# Client is suspended. Sleeping until the client should be restarted. When i wake up i will start the client
test_infinite ${suspend_resume[$(($i+1))]}
# Client is suspended. Sleeping until the client should be restarted. When i wake up i will start the client
test_infinite ${suspend_resume[$(($i+1))]}
@@
-128,4
+151,6
@@
test_infinite ${stop_time}
to_sleep=$((${stop_time} - ${old_time}))
sleep ${to_sleep}
to_sleep=$((${stop_time} - ${old_time}))
sleep ${to_sleep}
-stop_client ${CLIENT_TYPE}
+
+# stop client and monitoring script
+cleanup