无线Trace脚本(旧格式)-吞吐量

BEGIN {
init=0;
i=0;
}
{
event = $1;
time = $2;
node = $3;
trace_type = $4;
flag = $5;
uid = $6;
pkt_type = $7;
pkt_size = $8;
if(event=="r"&& pkt_type=="cbr") {
pkt_byte_sum[i+1]=pkt_byte_sum[i]+(pkt_size-20);
if(init==0)
{
start_time=time;
init=1;
}
end_time[i]=time;
i++;
}
}
END {
th = 8*pkt_byte_sum[i-1]/(end_time[i-1]-start_time)/1000;
printf("%.3f\n",th);
}


posted @ 2012-05-22 16:42  应律  阅读(185)  评论(0编辑  收藏  举报