use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.
the class CacheMgmtInterceptor method getApproximateEntries.
@ManagedAttribute(description = "Approximate number of entries currently in the cache, including persisted and expired entries", displayName = "Approximate number of entries")
public long getApproximateEntries() {
// Don't restrict the segments in case some writes used CACHE_MODE_LOCAL
IntSet allSegments = IntSets.immutableRangeSet(cacheConfiguration.clustering().hash().numSegments());
// Do restrict the segments when counting entries in shared stores
IntSet writeSegments;
if (distributionManager != null) {
writeSegments = distributionManager.getCacheTopology().getLocalWriteSegments();
} else {
writeSegments = allSegments;
}
long persistenceSize = CompletionStages.join(approximatePersistenceSize(allSegments, writeSegments));
return approximateTotalSize(persistenceSize, allSegments);
}
use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.
the class CacheMgmtInterceptor method getApproximateEntriesUnique.
@ManagedAttribute(description = "Approximate number of entries currently in the cache for which the local node is a primary " + "owner, including persisted and expired entries", displayName = "Approximate number of entries owned as primary")
public long getApproximateEntriesUnique() {
IntSet primarySegments;
if (distributionManager != null) {
LocalizedCacheTopology cacheTopology = distributionManager.getCacheTopology();
primarySegments = cacheTopology.getLocalPrimarySegments();
} else {
primarySegments = IntSets.immutableRangeSet(cacheConfiguration.clustering().hash().numSegments());
}
long persistenceSize = CompletionStages.join(approximatePersistenceSize(primarySegments, primarySegments));
return approximateTotalSize(persistenceSize, primarySegments);
}
use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.
the class DefaultCacheManager method getDefinedCacheNames.
@ManagedAttribute(description = "The defined cache names and their statuses. The default cache is not included in this representation.", displayName = "List of defined caches", dataType = DataType.TRAIT)
public String getDefinedCacheNames() {
StringJoiner stringJoiner = new StringJoiner("", "[", "]");
cacheManagerInfo.getDefinedCaches().forEach(c -> stringJoiner.add(c.name).add(c.isStarted() ? "(created)" : "(not created)"));
return stringJoiner.toString();
}
use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.
the class LocalCacheStatus method getClusterAvailability.
@ManagedAttribute(description = "Cluster availability", displayName = "Cluster availability", dataType = DataType.TRAIT, writable = false)
public String getClusterAvailability() {
AvailabilityMode clusterAvailability = AvailabilityMode.AVAILABLE;
synchronized (runningCaches) {
for (LocalCacheStatus cacheStatus : runningCaches.values()) {
AvailabilityMode availabilityMode = cacheStatus.getPartitionHandlingManager().getAvailabilityMode();
clusterAvailability = clusterAvailability.min(availabilityMode);
}
}
return clusterAvailability.toString();
}
use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.
the class DefaultCacheManager method getDefinedCacheConfigurationNames.
@ManagedAttribute(description = "The defined cache configuration names.", displayName = "List of defined cache configurations", dataType = DataType.TRAIT)
public String getDefinedCacheConfigurationNames() {
StringJoiner stringJoiner = new StringJoiner(",", "[", "]");
cacheManagerInfo.getCacheConfigurationNames().forEach(stringJoiner::add);
return stringJoiner.toString();
}
Aggregations