allow stats to be disabled by setting environment variable STATS=0

Allow stats collection to be disabled by setting STATS=0 in the environment.