Skip to content

Commit

Permalink
website response time
Browse files Browse the repository at this point in the history
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
  • Loading branch information
unixbhaskar committed Jan 29, 2023
1 parent f6e1ace commit 452c563
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions measure_website_response
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash
CURL="/usr/bin/curl"
GAWK="/usr/bin/gawk"
echo -n "Please pass the url you want to measure: "
read url
#!/usr/bin/env bash

# This script appeared in IBM Linux Technical Journal many moons ago. I have
# modified it to suit my convenience. Probably one written by M.Tim.Jones or
# Ian Shield ,not sure who it was, because I can't remember it.


CURL=$(command -v curl)
GAWK=$(command -v gawk)

echo -n "Please pass the url you want to measure: "
read url
URL="$url"

result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo " Time_Connect Time_startTransfer Time_total "
echo $result | $GAWK -F: '{ print $1" "$2" "$3}'
echo " Time_Connect Time_startTransfer Time_total "
echo $result | $GAWK -F: '{ print $1" "$2" "$3}'

0 comments on commit 452c563

Please sign in to comment.