3 ##############################################################################
4 # Copyright (c) 2016 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 ##############################################################################
12 # Run a ramspeed memory bandwidth benchmark in a host and
13 # output in json format the memory bandwidth in megabytes per second
20 OUTPUT_FILE=/tmp/ramspeed-out.log
24 cd /opt/tempT/RAMspeed/ramspeed-2.6.0/
25 ./ramspeed -b $TYPE_ID -g $LOAD -m $BLOCK_SIZE > $OUTPUT_FILE
28 # write the result to stdout in json format
31 SCORE=$(awk '/ /{printf "{\"Test_type\": \"%s %s %s\", \"Block_size(kb)\": %s, \"Bandwidth(MBps)\": %s},", $1, $2, $3, $4, $7}' $OUTPUT_FILE)
33 \"Result\":[${SCORE%?}] \