implement stats collector for sync gateway

Change-Id: Ie3c38ed0db16c9796a40e5079f15adbc24d204aa