summaryrefslogtreecommitdiffstats
path: root/tests/stress.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-10-13 08:37:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-10-13 08:38:18 +0000
commitca540a730c0b880922e86074f994a95b8d413bea (patch)
tree1364a1b82cfcc68f51aabf9b2545e6a06059d6bb /tests/stress.sh
parentReleasing debian version 1.17.1-1. (diff)
downloadnetdata-ca540a730c0b880922e86074f994a95b8d413bea.tar.xz
netdata-ca540a730c0b880922e86074f994a95b8d413bea.zip
Merging upstream version 1.18.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/stress.sh')
-rwxr-xr-xtests/stress.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/stress.sh b/tests/stress.sh
index 9c9393d3b..97cced032 100755
--- a/tests/stress.sh
+++ b/tests/stress.sh
@@ -1,8 +1,14 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
+if ! hash curl 2>/dev/null
+then
+ 1>&2 echo "'curl' not found on system. Please install 'curl'."
+ exit 1
+fi
+
# set the host to connect to
-if [ ! -z "$1" ]
+if [ -n "$1" ]
then
host="$1"
else
@@ -11,17 +17,17 @@ fi
echo "using netdata server at: $host"
# shellcheck disable=SC2207 disable=SC1117
-charts=($(curl "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u))
+charts=($(curl -k "$host/netdata.conf" 2>/dev/null | grep "^\[" | cut -d '[' -f 2 | cut -d ']' -f 1 | grep -v ^global$ | grep -v "^plugin" | sort -u))
if [ "${#charts[@]}" -eq 0 ]
then
echo "Cannot download charts from server: $host"
exit 1
fi
-update_every="$(curl "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)"
+update_every="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "update every = " | head -n 1 | cut -d '=' -f 2)"
[ $(( update_every + 1 - 1)) -eq 0 ] && update_every=1
-entries="$(curl "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)"
+entries="$(curl -k "$host/netdata.conf" 2>/dev/null | grep "history = " | head -n 1 | cut -d '=' -f 2)"
[ $(( entries + 1 - 1)) -eq 0 ] && entries=3600
# to compare equal things, set the entries to 3600 max
@@ -49,7 +55,7 @@ trap cleanup EXIT
while true
do
- echo "curl --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file"
+ echo "curl -k --compressed --keepalive-time 120 --header \"Connection: keep-alive\" \\" >"$file"
# shellcheck disable=SC2034
for x in {1..100}
do