Write out a stats file for use with plugins, if we can