@Test
    public void testIoMetricsHaveCorrectDoc() {
        Predicate<MetricName> docDeprecated =
                mName -> mName.description().toLowerCase(Locale.ROOT).contains("deprecated");

        List<String> actual = asList("io-ratio", "io-wait-ratio");
        assertEquals(
                actual.size(),
                metrics.metrics().keySet().stream()
                        .filter(m -> actual.contains(m.name()))
                        .filter(m -> !docDeprecated.test(m))
                        .count(),
                "Metrics " + actual + " should be registered as non-deprecated"
        );

        List<String> deprecated = asList("iotime-total", "io-waittime-total");
        assertEquals(
                deprecated.size(),
                metrics.metrics().keySet().stream()
                        .filter(m -> deprecated.contains(m.name()))
                        .filter(docDeprecated)
                        .count(),
                "Metrics " + deprecated + " should be registered as deprecated"
        );
    }
Validate that correct subset of io metrics marked deprecated in docs
clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java