metrics.sh/reporters/stathat.sh

20 lines
434 B
Bash
Raw Normal View History

2015-02-21 18:18:27 +01:00
#!/bin/sh
init () {
if [ -z $STATHAT_API_KEY ]; then
echo "Error: stathat requires \$STATHAT_API_KEY to be set"
exit 1
fi
}
2015-02-21 18:18:27 +01:00
report () {
2015-03-14 13:32:26 +01:00
local METRIC=$1
local VALUE=$2
curl -s -d "stat=$METRIC&ezkey=$STATHAT_API_KEY&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>"
2015-02-21 18:18:27 +01:00
}