3 ##############################################################################
4 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
14 # Commandline arguments
16 OUTPUT_FILE=/tmp/netperf-out.log
21 netperf $OPTIONS > $OUTPUT_FILE
24 # write the result to stdout in json format
27 mean=$(awk '/\/s/{print $3}' $OUTPUT_FILE)
28 troughput=$(awk '/\/s/{print $1}' $OUTPUT_FILE)
29 unit=$(awk '/\/s/{print $2}' $OUTPUT_FILE)
31 \"mean_latency\":\"$mean\", \
32 \"troughput\":\"$troughput\", \
33 \"troughput_unit\":\"$unit\" \