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

def metric(cls, name, count, elapsed):
        """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
        """

        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))