metrics.sh/reporters/stathat.sh
2015-03-14 21:44:06 +01:00

21 lines
441 B
Bash

#!/bin/sh
init () {
if [ -z $STATHAT_API_KEY ]; then
echo "Error: stathat requires \$STATHAT_API_KEY to be specified"
exit 1
fi
}
report () {
local metric=$1
local value=$2
curl -s -d "ezkey=$STATHAT_API_KEY&stat=$metric&value=$value" \
http://api.stathat.com/ez > /dev/null
}
docs () {
echo "Send data to StatHat (https://www.stathat.com)."
echo "\$STATHAT_API_KEY=<ez_key>"
}