Db counter

cleanup the streaming (now uses a queue) and added counters