code: def metric(cls, name, count, elapsed):
          
  
          if name is None:
              warnings.warn("Ignoring unnamed metric", stacklevel=3)
              return
  
          with cls.lock:
              # register with atexit on first call
              if cls.dump_atexit and not cls.instances:
                  atexit.register(cls.dump)
  
              try:
                  self = cls.instances[name]
              except KeyError:
                  self = cls.instances[name] = cls(name)
  
              self.temp.write(self.struct.pack(count, elapsed))
docs: A metric function that buffers through numpy
  
          :arg str name: name of the metric
          :arg int count: number of items
          :arg float elapsed: time in seconds