Skip to content

Commit a144ccf

Browse files
authored
Support shard region stats without any actors. (#144)
1 parent 724e7bf commit a144ccf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/arpnetworking/clusteraggregator/ClusterStatusCache.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ public Receive createReceive() {
149149
}
150150
for (final Map.Entry<String, Integer> entry : shardsPerAddress.entrySet()) {
151151
try (Metrics metrics = _metricsFactory.create()) {
152-
final Long actorCount = actorsPerAddress.get(entry.getKey());
153152
metrics.addAnnotation("address", entry.getKey());
154153
metrics.setGauge("akka/cluster/shards", entry.getValue());
155-
metrics.setGauge("akka/cluster/actors", actorCount);
154+
@Nullable final Long actorCount = actorsPerAddress.get(entry.getKey());
155+
if (actorCount != null) {
156+
metrics.setGauge("akka/cluster/actors", actorCount);
157+
}
156158
}
157159
}
158160
})

0 commit comments

Comments
 (0)