Created
April 30, 2013 17:08
-
-
Save anonymous/5490181 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
pckt_snt = 0 | |
pckt_recvd = 0 | |
pckt_lost = 0 | |
} | |
{ | |
if ("r" == $1 && ("tcp" == $5)){# || "cbr" == $5)){ | |
if ($2 > 0.0 && $2 <= 0.5){ | |
cont1 += 1 | |
} | |
else if ($2 > 0.5 && $2 <= 1.0){ | |
cont2 += 1 | |
} | |
else if ($2 > 1 && $2 <= 1.5){ | |
cont3 += 1 | |
} | |
else if ($2 > 1.5 && $2 <= 2.0){ | |
cont4 += 1 | |
} | |
for (dst_node = 0; dst_node <= 5; dst_node ++){ | |
if (dst_node == $4){ | |
pckt_recvd += 1 | |
} | |
for (src_node = 0; src_node <= 5; src_node ++){ | |
if (src_node == $3){ | |
pckt_snt += 1 | |
} | |
} | |
} | |
} | |
prom = (cont1+cont2+cont3+cont4)/4 | |
} | |
END { | |
printf("Paquetes enviados: %g\nPaquetes recibidos: %g\nPaquetes perdidos: %g\nPaquetes por medio segundo: %g\n", pckt_snt, pckt_recvd, pckt_snt-pckt_recvd,prom) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment