write stats in configurable file