count metrics in goroutines