Search in sources :

Example 6 with ManagedAttribute

use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.

the class RpcManagerImpl method getPendingViewAsString.

@ManagedAttribute(description = "Retrieves the pending view.", displayName = "Pending view", dataType = DataType.TRAIT)
public String getPendingViewAsString() {
    CacheTopology cacheTopology = distributionManager.getCacheTopology();
    if (cacheTopology == null)
        return "N/A";
    ConsistentHash pendingCH = cacheTopology.getPendingCH();
    return pendingCH != null ? pendingCH.getMembers().toString() : "null";
}
Also used : ConsistentHash(org.infinispan.distribution.ch.ConsistentHash) CacheTopology(org.infinispan.topology.CacheTopology) ManagedAttribute(org.infinispan.jmx.annotations.ManagedAttribute)

Example 7 with ManagedAttribute

use of org.infinispan.jmx.annotations.ManagedAttribute in project infinispan by infinispan.

the class NettyTransport method getPendingTasks.

@ManagedAttribute(description = "Returns the number of pending tasks.", displayName = "Pending tasks")
@Override
public int getPendingTasks() {
    AtomicInteger count = new AtomicInteger(0);
    ioGroup.forEach(ee -> count.addAndGet(((SingleThreadEventExecutor) ee).pendingTasks()));
    return count.get();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SingleThreadEventExecutor(io.netty.util.concurrent.SingleThreadEventExecutor) ManagedAttribute(org.infinispan.jmx.annotations.ManagedAttribute)

Aggregations

ManagedAttribute (org.infinispan.jmx.annotations.ManagedAttribute)7 StringJoiner (java.util.StringJoiner)2 IntSet (org.infinispan.commons.util.IntSet)2 SingleThreadEventExecutor (io.netty.util.concurrent.SingleThreadEventExecutor)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 LocalizedCacheTopology (org.infinispan.distribution.LocalizedCacheTopology)1 ConsistentHash (org.infinispan.distribution.ch.ConsistentHash)1 AvailabilityMode (org.infinispan.partitionhandling.AvailabilityMode)1 CacheTopology (org.infinispan.topology.CacheTopology)1