Search in sources :

Example 1 with LocalFlakeIdGeneratorStats

use of com.hazelcast.internal.monitor.LocalFlakeIdGeneratorStats in project hazelcast by hazelcast.

the class FlakeIdGenerator_MemberIntegrationTest method statistics.

@Test
public void statistics() {
    HazelcastInstance instance = factory.newHazelcastInstance();
    FlakeIdGenerator gen = instance.getFlakeIdGenerator("gen");
    gen.newId();
    FlakeIdGeneratorService service = getNodeEngineImpl(instance).getService(FlakeIdGeneratorService.SERVICE_NAME);
    Map<String, LocalFlakeIdGeneratorStats> stats = service.getStats();
    assertTrue(!stats.isEmpty());
    assertTrue(stats.containsKey("gen"));
    LocalFlakeIdGeneratorStats genStats = stats.get("gen");
    assertEquals(1L, genStats.getBatchCount());
    assertTrue(genStats.getIdCount() > 0);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) FlakeIdGenerator(com.hazelcast.flakeidgen.FlakeIdGenerator) LocalFlakeIdGeneratorStats(com.hazelcast.internal.monitor.LocalFlakeIdGeneratorStats) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 FlakeIdGenerator (com.hazelcast.flakeidgen.FlakeIdGenerator)1 LocalFlakeIdGeneratorStats (com.hazelcast.internal.monitor.LocalFlakeIdGeneratorStats)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1