为方便读者,本教材中连续四行及以上程序源码(脚本),本网站将直接提供,直接输入使用。
set term eps
set out "result.eps"
set size 1,0.7
set key right bottom
set xrange [0:50]
set ylabel "吞吐量(KBps)"
set xlabel "时间(s)"
plot "hidden.d" u 1:2 w lp lw 2 lc rgb "black" t "Flow 1:n0->n1", "hidden.d" u 1:3 w lp lw 2 lc rgb "grey" t "Flow 1:n2->n1"
BEGIN {
sendLine = 0;
recvLine = 0;
}
$0 ~/^s.* AGT/ {
sendLine++;
}
$0 ~/^r.* AGT/{
recvLine++;
}
END {
printf "Sent: %d Received: %d, Delivery Ratio:%.4f\n", sendLine, recvLine, (recvLine/sendLine);
}
set term png
set out "result.png"
set key right bottom
set xrange [0:50]
set ylabel "吞吐量(KBps)"
set xlabel "时间(s)"
plot "exposed.d" u 1:2 w lp lw 2 lc rgb "black" t "Flow 1:n0->n1","exposed.d" u 1:3 w lp lw 2 lc rgb "grey" t "Flow 1:n2->nl"