Dienstag, 26. September 2017

JMeter-CSV, logische Transaktionen aus mehreren Requests, die Shell und ich.

Lösung:
( grep -v '^timeStamp' results.csv | awk --field-separator=';' '{ print $6";"$1";"$2";"$3 }' \
| sort | while read a; do OP=`echo "$a" | cut -d ';' -f 4`; TS=`echo "$a" | cut -d ';' -f 2`; \
TM=`echo "$a" | cut -d ';' -f 3`; if [ "$OP" = getConfiguration ]; then echo '`'; echo -n \
"$TS \`expr $TM"; else echo -n " + $TM"; fi; done | grep -v '^`' | tr -d '\n' ; echo '`' ) | \
while read b; do eval "echo $b"; done | sort >transaction-timings.dat

Versuch, das lesbar zu machen...
( grep -v '^timeStamp' results.csv \
    | awk --field-separator=';' '{ print $6";"$1";"$2";"$3 }' \
    | sort \
    | while read a; do \
        OP=`echo "$a" | cut -d ';' -f 4`; \
        TS=`echo "$a" | cut -d ';' -f 2`; \
        TM=`echo "$a" | cut -d ';' -f 3`; \
        if [ "$OP" = getConfiguration ]; then \
            echo '`'; \
            echo -n "$TS \`expr $TM"; \
        else \
            echo -n " + $TM"; \
        fi; \
    done \
        | grep -v '^`' \
        | tr -d '\n'; \
        echo '`' ) \
        | while read b; do \
            eval "echo $b"; \
          done \
              | sort >transaction-timings.dat