use of com.hazelcast.client.impl.ClientEndpointStatisticsSnapshot in project hazelcast by hazelcast.
the class ClientInfoCollector method forEachMetric.
@Override
public void forEachMetric(Node node, BiConsumer<PhoneHomeMetrics, String> metricsConsumer) {
ClientEngine clientEngine = node.getClientEngine();
Map<String, Long> activeClients = clientEngine.getActiveClientsInCluster();
Map<String, ClientEndpointStatisticsSnapshot> snapshots = clientEngine.getEndpointStatisticsSnapshots();
CLIENT_TYPE_TO_HELPER.forEach((clientType, helper) -> {
long clientCount = activeClients.getOrDefault(clientType, 0L);
ClientEndpointStatisticsSnapshot snapshot = snapshots.get(clientType);
helper.collectMetrics(clientCount, snapshot, metricsConsumer);
});
metricsConsumer.accept(PhoneHomeMetrics.CLIENT_ENDPOINT_COUNT, MetricsCollector.convertToLetter(node.clientEngine.getClientEndpointCount()));
}
Aggregations