metrics.sh/reporters/stathat.sh

21 lines
407 B
Bash
Raw Normal View History

2015-02-21 18:18:27 +01:00
#!/bin/sh
start () {
if [ -z $STATHAT_API_KEY ]; then
echo "Error: stathat requires \$STATHAT_API_KEY to be specified"
2015-03-22 18:01:27 +01:00
return 1
fi
}
2015-02-21 18:18:27 +01:00
report () {
local metric=$1
local value=$2
2015-03-22 18:01:27 +01:00
curl -s http://api.stathat.com/ez \
-d "ezkey=$STATHAT_API_KEY&stat=$metric&value=$value"
}
docs () {
echo "Send data to StatHat (https://www.stathat.com)."
echo "STATHAT_API_KEY=$STATHAT_API_KEY"
2015-02-21 18:18:27 +01:00
}