code: def dump_stats(filename):
      # type: (str) -> None
      
      res = _dump_impl()
      f = open(filename, 'w')
      json.dump(res, f, indent=4)
      f.close()
docs: Write collected information to file.
  
      Args:
          filename: absolute filename