use of com.hazelcast.cp.internal.raft.impl.RaftRole in project hazelcast by hazelcast.
the class RaftService method provideDynamicMetrics.
@Override
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) {
MetricDescriptor rootDescriptor = descriptor.withPrefix(CP_PREFIX_RAFT_GROUP);
for (Entry<CPGroupId, RaftNodeMetrics> entry : nodeMetrics.entrySet()) {
CPGroupId groupId = entry.getKey();
RaftRole role = entry.getValue().role;
MetricDescriptor groupDescriptor = rootDescriptor.copy().withDiscriminator(CP_DISCRIMINATOR_GROUPID, String.valueOf(groupId.getId())).withTag(CP_TAG_NAME, groupId.getName()).withTag("role", role != null ? role.toString() : "NONE");
context.collect(groupDescriptor, entry.getValue());
}
}
Aggregations