source: branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/scripts/unicast_latency.sh @ 998

Last change on this file since 998 was 998, checked in by cfuguet, 9 years ago

reconf: several improvements in the dspin_router synthetic test platform

  • Property svn:executable set to *
File size: 557 bytes
Line 
1#!/usr/bin/env sh
2# @author       Cesar Armando Fuguet Tortolero
3# @date         24 May, 2015
4# @brief
5file=$1
6awk '
7BEGIN {
8        total=0
9        total_load=0
10        targets=0
11}
12
13#   Parse the number of received packets
14/unicast received packets +=/ {
15        packets=$6
16}
17
18#   Parse the unicast latency
19/unicast latency +=/ {
20        latency=$5;
21        total+=latency;
22        if (latency > 0) {
23                targets++;
24        }
25}
26
27/accepted load +=/ {
28        total_load+=$5;
29}
30
31#   Validate the file
32END {
33        print "mean latency=" total/targets
34        print "mean load=" total_load/targets
35        exit 0;
36}' $file
37if [[ $? == 1 ]]; then exit 1; fi
38
Note: See TracBrowser for help on using the repository browser.