Added metric gathering and posting with working tests