Counters patch to dump counters to a json file in the specified folder

This json file can be later used to report metrics to data dog, etc.

Too late it seems, but I'd highly recommend against `json-smart`.