Batched metrics| Add tests to verify that the buffer is always emptied