measure-throughput.awk
上传用户:sy0851
上传日期:2014-07-16
资源大小:4k
文件大小:1k
- BEGIN {
- init=0;
- i=0;
- }
- {
- action = $1;
- time = $2;
- from = $3;
- to = $4;
- type = $7;
- pktsize = $6;
- flow_id = $8;
- src = $9;
- dst = $10;
- seq_no = $11;
- packet_id = $6;
-
- if(action=="r" && from==2 && to==3 && type=="cbr") {
- pkt_byte_sum[i+1]=pkt_byte_sum[i]+ pktsize;
-
- if(init==0) {
- start_time = time;
- init = 1;
- }
-
- end_time[i] = time;
- i = i+1;
- }
- }
- END {
- printf("%.2ft%.2fn", end_time[0], 0);
-
- for(j=1 ; j<i ; j++){
- th = pkt_byte_sum[j] / (end_time[j] - start_time)*8/1000;
- printf("%.2ft%.2fn", end_time[j], th);
- }
- printf("%.2ft%.2fn", end_time[i-1], 0);
- }