APISonar


org.apache.cassandra.hints.HintsService.instance.metrics.log

> org > apache > cassandra > hints > HintsService > instance > metrics > log
org APIs apache APIs cassandra APIs hints APIs HintsService APIs instance APIs metrics APIs log APIs

Example 1
public void testHintsMetrics() throws Exception
    {
        DatabaseDescriptor.getHintsDirectory().mkdirs();

        for (int i = 0; i < 99; i++)
            HintsService.instance.metrics.incrPastWindow(InetAddress.getLocalHost());
        HintsService.instance.metrics.log();

        UntypedResultSet rows = executeInternal("SELECT hints_dropped FROM system." + SystemKeyspace.PEER_EVENTS);
        Map<UUID, Integer> returned = rows.one().getMap("hints_dropped", UUIDType.instance, Int32Type.instance);
        assertEquals(Iterators.getLast(returned.values().iterator()).intValue(), 99);
    }