#!/bin/sh
##
##  stats -- mininum StatsD metric sending client
##

if [ $# -lt 3 ] || [ $# -gt 5 ]; then
    echo "USAGE: stats <metric> <value> <type> [<host> [<port>]]" 1>&2
    exit 1
fi

metric="$1"
value="$2"
type="$3"
host="${4-127.0.0.1}"
port="${5-8125}"

echo "$metric:$value|$type" |\
    @l_prefix@/bin/socat - "udp-sendto:$host:$port"

