Last Updated: January 28, 2019
· errordeveloper

Measure HTTP response times with cURL and store it on Cosm

Here is a nice and simple way of measuring HTTP response of a given web site and storing the results on Cosm database. You should get some nice graphs after running this for some time as a cron job.


API_KEY='<Your Cosm API key>'
FEED_ID='<Your Cosm feed ID>' 

#EXTRA_FLAGS='--verbose --location'

response_test () {

  ## See curl(1) for description of the variables

  curl $1 $common --output /dev/null $EXTRA_FLAGS --write-out $format \
   | curl $common --data-binary @- \
     -X 'PUT' \
     -H 'Host:' \
     -H "X-ApiKey: $3" \$2.csv

response_test $MY_SITE $FEED_ID $API_KEY

Of coure, you can improve this to actually send some payload to your site and not!