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.

Indentation appears to be off here.