private void commit(final Map<TopicPartition, OffsetAndMetadata> offsets) {
        if (processingMode == EXACTLY_ONCE_ALPHA || processingMode == EXACTLY_ONCE_V2) {
            testDriverProducer.commitTransaction(offsets, new ConsumerGroupMetadata("dummy-app-id"));
        } else {
            consumer.commitSync(offsets);
        }
    }
Get read-only handle on global metrics registry.

@return Map of all metrics.
streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java