@Test
    public void testQueriesPerSecondCollectedWhenProfiling() throws Exception
    {
        // Setup test fixture.
        ProfiledConnection.start();

        // Execute system under test.
        ProfiledConnection.addQuery(ProfiledConnection.Type.select, "SELECT 1", Duration.ofMillis(2));
        final double result = ProfiledConnection.getQueriesPerSecond(ProfiledConnection.Type.select);

        // Verify results.
        assertNotEquals(0, result);
    }
Unit tests that verify the functionality of {@link ProfiledConnection}

@author Guus der Kinderen, guus.der.kinderen@gmail.com
xmppserver/src/test/java/org/jivesoftware/database/ProfiledConnectionTest.java