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);
}
Aggregations