Created
September 10, 2013 23:37
-
-
Save eric/6517261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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