Deprecate install_test.sh script
The script `samples/tasks/support/instance_test.sh` was absorbed by VMTasks.dd_load scenario. To do not support 2 places of one thing, this script should be removed. Change-Id: I7ba29f07554e22c70dd46cbe19e8b40a71ef90d3
This commit is contained in:
parent
74bfd34f79
commit
a913477f2b
@ -8,5 +8,4 @@ To run this workload, the VM must have linpack installed prior to running.
|
||||
instance_test.sh
|
||||
================
|
||||
|
||||
instance_test.sh loads server by spawning processes. Finally, it outputs
|
||||
JSON data for HTML report charts, with values of CPU, memory and disk usage.
|
||||
The script was absorbed by VMTasks.dd_load_test scenario.
|
||||
|
@ -1,107 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Load server and output JSON results ready to be processed
|
||||
# by Rally scenario
|
||||
|
||||
for ex in awk top grep free tr df dc dd gzip
|
||||
do
|
||||
if ! type ${ex} >/dev/null
|
||||
then
|
||||
echo "Executable is required by script but not available on a server: ${ex}" >&2
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
get_used_cpu_percent() {
|
||||
echo 100 $(top -b -n 1 | grep -i CPU | head -n 1 | awk '{print $8}' | tr -d %) - p | dc
|
||||
}
|
||||
|
||||
get_used_ram_percent() {
|
||||
local total=$(free | grep Mem: | awk '{print $2}')
|
||||
local used=$(free | grep -- -/+\ buffers | awk '{print $3}')
|
||||
echo ${used} 100 \* ${total} / p | dc
|
||||
}
|
||||
|
||||
get_used_disk_percent() {
|
||||
df -P / | grep -v Filesystem | awk '{print $5}' | tr -d %
|
||||
}
|
||||
|
||||
get_seconds() {
|
||||
(time -p ${1}) 2>&1 | awk '/real/{print $2}'
|
||||
}
|
||||
|
||||
complete_load() {
|
||||
local script_file=${LOAD_SCRIPT_FILE:-/tmp/load.sh}
|
||||
local stop_file=${LOAD_STOP_FILE:-/tmp/load.stop}
|
||||
local processes_num=${LOAD_PROCESSES_COUNT:-20}
|
||||
local size=${LOAD_SIZE_MB:-5}
|
||||
|
||||
cat << EOF > ${script_file}
|
||||
until test -e ${stop_file}
|
||||
do dd if=/dev/urandom bs=1M count=${size} 2>/dev/null | gzip >/dev/null ; done
|
||||
EOF
|
||||
|
||||
local sep
|
||||
local cpu
|
||||
local ram
|
||||
local dis
|
||||
rm -f ${stop_file}
|
||||
for i in $(seq ${processes_num})
|
||||
do
|
||||
i=$((i-1))
|
||||
sh ${script_file} &
|
||||
cpu="${cpu}${sep}[${i}, $(get_used_cpu_percent)]"
|
||||
ram="${ram}${sep}[${i}, $(get_used_ram_percent)]"
|
||||
dis="${dis}${sep}[${i}, $(get_used_disk_percent)]"
|
||||
sep=", "
|
||||
done
|
||||
> ${stop_file}
|
||||
cat << EOF
|
||||
{
|
||||
"title": "Generate load by spawning processes",
|
||||
"description": "Each process runs gzip for ${size}M urandom data in a loop",
|
||||
"chart_plugin": "Lines",
|
||||
"axis_label": "Number of processes",
|
||||
"label": "Usage, %",
|
||||
"data": [
|
||||
["CPU", [${cpu}]],
|
||||
["Memory", [${ram}]],
|
||||
["Disk", [${dis}]]]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
additive_dd() {
|
||||
local c=${1:-50} # Megabytes
|
||||
local file=/tmp/dd_test.img
|
||||
local write=$(get_seconds "dd if=/dev/urandom of=${file} bs=1M count=${c}")
|
||||
local read=$(get_seconds "dd if=${file} of=/dev/null bs=1M count=${c}")
|
||||
local gzip=$(get_seconds "gzip ${file}")
|
||||
rm ${file}.gz
|
||||
cat << EOF
|
||||
{
|
||||
"title": "Write, read and gzip file",
|
||||
"description": "Using file '${file}', size ${c}Mb.",
|
||||
"chart_plugin": "StackedArea",
|
||||
"data": [
|
||||
["write_${c}M", ${write}],
|
||||
["read_${c}M", ${read}],
|
||||
["gzip_${c}M", ${gzip}]]
|
||||
},
|
||||
{
|
||||
"title": "Statistics for write/read/gzip",
|
||||
"chart_plugin": "StatsTable",
|
||||
"data": [
|
||||
["write_${c}M", ${write}],
|
||||
["read_${c}M", ${read}],
|
||||
["gzip_${c}M", ${gzip}]]
|
||||
}
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
cat << EOF
|
||||
{
|
||||
"additive": [$(additive_dd)],
|
||||
"complete": [$(complete_load)]
|
||||
}
|
||||
EOF
|
||||
echo "The script was absorbed by VMTasks.dd_load_test scenario."
|
||||
# If we do not fail it, no one will found the warning message about deprecation
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user