Skip to content

Instantly share code, notes, and snippets.

@eric
Created September 10, 2013 23:37
Show Gist options
  • Save eric/6517261 to your computer and use it in GitHub Desktop.
Save eric/6517261 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
USERNAME=
TOKEN=
METRIC=
SLEEP=5
probe() {
TIMEFORMAT="duration=%R"
local url="https://metrics-api.librato.com/v1/metrics/$METRIC"
local t0=$(date "+%s")
( time curl -isu "$USERNAME:$TOKEN" "$url" | awk '/^HTTP\/1/ { print "status=" $2 }' ) 2>&1 | xargs echo "t0=$t0" &
}
while true; do probe; sleep 5; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment