Package org.infinispan.stats.impl
Class LocalContainerStatsImpl
java.lang.Object
org.infinispan.stats.impl.LocalContainerStatsImpl
- All Implemented Interfaces:
JmxStatisticsExposer,ContainerStats
@MBean(objectName="LocalContainerStats",
description="General statistic of local container.")
public class LocalContainerStatsImpl
extends Object
implements ContainerStats
Provide statistics of the local JVM instance. When the statistics collection is disabled, we return -1.
- Since:
- 14.0
- Author:
- José Bolina
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final Stringprotected longprotected longFields inherited from interface org.infinispan.stats.ContainerStats
LONG_ATTRIBUTES, MEMORY_AVAILABLE, MEMORY_MAX, MEMORY_TOTAL, MEMORY_USED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglonglonglonglongprotected NumberbooleanReturns whether an interceptor's statistics are being captured.longvoidinit(GlobalConfiguration configuration) booleanvoidreset()voidResets an interceptor's cache statisticsvoidsetStaleStatsThreshold(long staleStatsThreshold) voidsetStatisticsEnabled(boolean enabled) Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.
-
Field Details
-
LOCAL_CONTAINER_STATS
- See Also:
-
DEFAULT_STALE_STATS_THRESHOLD
public static final long DEFAULT_STALE_STATS_THRESHOLD- See Also:
-
staleStatsThreshold
protected volatile long staleStatsThreshold -
statsUpdateTimestamp
protected volatile long statsUpdateTimestamp
-
-
Constructor Details
-
LocalContainerStatsImpl
public LocalContainerStatsImpl()
-
-
Method Details
-
init
-
getMemoryAvailable
@ManagedAttribute(description="The maximum amount of free memory in bytes in local JVM", displayName="Local available memory.") public long getMemoryAvailable()- Specified by:
getMemoryAvailablein interfaceContainerStats- Returns:
- the maximum amount of free memory in bytes across the cluster JVMs.
-
getMemoryMax
@ManagedAttribute(description="The maximum amount of memory in local JVM will attempt to utilise in bytes", displayName="Local JVM max memory") public long getMemoryMax()- Specified by:
getMemoryMaxin interfaceContainerStats- Returns:
- the maximum amount of memory that JVMs across the cluster will attempt to utilise in bytes.
-
getMemoryTotal
@ManagedAttribute(description="The total amount of memory in the local JVM in bytes", displayName="Local total memory") public long getMemoryTotal()- Specified by:
getMemoryTotalin interfaceContainerStats- Returns:
- the total amount of memory in the JVMs across the cluster in bytes.
-
getMemoryUsed
@ManagedAttribute(description="The amount of memory used by the local JVM in bytes", displayName="Local memory utilisation") public long getMemoryUsed()- Specified by:
getMemoryUsedin interfaceContainerStats- Returns:
- the amount of memory used by JVMs across the cluster in bytes.
-
getStaleStatsThreshold
@ManagedAttribute(description="Gets the threshold for cluster wide stats refresh (milliseconds)", displayName="Stale Stats Threshold", dataType=TRAIT, writable=true) public long getStaleStatsThreshold() -
getTimeSinceReset
@ManagedAttribute(description="Number of seconds since the statistics were last reset", displayName="Seconds since statistics were reset", units=SECONDS) public long getTimeSinceReset() -
isStatisticsEnabled
@ManagedAttribute(description="Enables or disables the gathering of statistics by this component", displayName="Statistics enabled", dataType=TRAIT, writable=true) public boolean isStatisticsEnabled() -
reset
public void reset() -
resetStatistics
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset statistics") public void resetStatistics()Description copied from interface:JmxStatisticsExposerResets an interceptor's cache statistics- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled) Description copied from interface:JmxStatisticsExposerEnables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.- Specified by:
setStatisticsEnabledin interfaceJmxStatisticsExposer- Parameters:
enabled- true if statistics should be captured
-
getStatisticsEnabled
public boolean getStatisticsEnabled()Description copied from interface:JmxStatisticsExposerReturns whether an interceptor's statistics are being captured.- Specified by:
getStatisticsEnabledin interfaceJmxStatisticsExposer- Returns:
- true if statistics are captured
-
setStaleStatsThreshold
public void setStaleStatsThreshold(long staleStatsThreshold) -
getStat
-