#!/usr/bin/env bash
HOST=127.0.0.1
PORT=2003

ts=`date +%s`
for row in $(gocoverstats -f $ts -v 2> /dev/null | grep -v unweighted | sed -E -e 's/github\.com\/nsqio/coverage/' -e 's/\//./g' -e's/ +/:/'); do
	msg=$(echo $(echo $row | tr -s : ' ') $ts)
	echo $msg | tee /dev/tty | nc -w0 $HOST $PORT
done
