code: def dumpStatsTo(filename):
    
    with open(filename, 'w') as f:
      latest = getStats()
      latest['last-updated'] = time.time()
      json.dump(getStats(), f, cls=StatContainerEncoder)
docs: Writes the stats dict to filanem