summaryrefslogtreecommitdiff
path: root/bin/respondtime.sh
blob: 6d5b9e458f3a4af29515e566c2b230a9423b979c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# use cURL to measure the time until the webpage loads

CURLINFOTEXT="
    time_namelookup:  %{time_namelookup}

       time_connect:  %{time_connect}

    time_appconnect:  %{time_appconnect}

   time_pretransfer:  %{time_pretransfer}

      time_redirect:  %{time_redirect}

 time_starttransfer:  %{time_starttransfer}

                    ----------

         time_total:  %{time_total}
"

if [ -z "$1" ]; then
	echo "$(tput setaf 1)$(tput bold)Failure. $(tput sgr0)Missing URL or Hostname" 1>&2
	exit 1
fi

curl -w "$CURLINFOTEXT" -o /dev/null -s "$1"