LOG_FOLDER=$1
LOG_FILE=$2
DATA_FILE=$LOG_FOLDER/${LOG_FILE}.data
-PEER_DOWNLOAD_FILE=$LOG_FOLDER/${LOG_FILE}.down
-PEER_UPLOAD_FILE=$LOG_FOLDER/${LOG_FILE}.up
+PEER_UPLOAD_DOWNLOAD_FILE=$LOG_FOLDER/${LOG_FILE}.updown
# Check if the log folder exists
if [ ! -d $LOG_FOLDER ]; then
hostname=$1
veid=${hostname##*-}
- tmp=${hostname%-*}
+tmp=${hostname%-*}
host_id=${tmp##*-}
host_veid_to_eth_ip $host_id $veid
i = 6;
for (i = 6; i < NF; i += 6) {
j = i+2;
- speed = $j + 0;
+ k = i+4;
+ down_speed = $j + 0;
+ up_speed = $k + 0;
split($i, ip_port, ":");
- printf " (%s, %s, %s)", ip, ip_port[1], speed;
+ printf " (%s, %s, %s, %s)", ip, ip_port[1], down_speed, up_speed;
}
printf "\n";
-}' > $PEER_DOWNLOAD_FILE
-
-grep '^--Peers\|SLEEP' $LOG_FOLDER/$LOG_FILE | awk -v ip=${local_ip} -F '[],() []+' '
-{
- printf "[%s %s %s]", $2, $3, $4;
- i = 6;
- for (i = 6; i < NF; i += 6) {
- j = i+4;
- speed = $j + 0;
- split($i, ip_port, ":");
- printf " (%s, %s, %s)", ip, ip_port[1], speed;
- }
- printf "\n";
-}' > $PEER_UPLOAD_FILE
+}' > $PEER_UPLOAD_DOWNLOAD_FILE
exit 0