code: def metric(cls, name, count, elapsed):
          
  
          if name is None:
              warnings.warn("Ignoring unnamed metric", stacklevel=3)
              return
  
          with cls.lock:
              if not cls.instances:
                  # first call
                  shutil.rmtree(cls.outdir, ignore_errors=True)
                  os.makedirs(cls.outdir)
  
                  if cls.dump_atexit: atexit.register(cls.dump)
  
              try:
                  self = cls.instances[name]
              except KeyError:
                  self = cls.instances[name] = cls(name)
  
              self.writer.writerow((count, "%f"%elapsed))
docs: A metric function that writes multiple CSV files
  
          :arg str name: name of the metric
          :arg int count: number of items
          :arg float elapsed: time in seconds