protected void verifyConnectionMetrics(String metricsJson, int expectedOpenConnections,
                                         int expectedCumulativeConnections) throws Exception {
    MetricsTestUtils.verifyMetricsJson(metricsJson, MetricsTestUtils.COUNTER,
            MetricsConstant.OPEN_CONNECTIONS, expectedOpenConnections);
    MetricsTestUtils.verifyMetricsJson(metricsJson, MetricsTestUtils.COUNTER,
            MetricsConstant.CUMULATIVE_CONNECTION_COUNT, expectedCumulativeConnections);
  }
Abstract class for connection metrics tests. Implementors of this class are
{@link TestHs2ConnectionMetricsBinary} and {@link TestHs2ConnectionMetricsBinary}. These two
classes are responsible for testing the connection metrics either in binary or in http mode.
itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/Hs2ConnectionMetrics.java