Class ClusterMetricsSnapshot
- java.lang.Object
-
- org.apache.ignite.internal.ClusterMetricsSnapshot
-
- All Implemented Interfaces:
ClusterMetrics
public class ClusterMetricsSnapshot extends Object implements ClusterMetrics
Implementation forClusterMetrics
interface.Note that whenever adding or removing metric parameters, care must be taken to update serialize/deserialize logic as well.
-
-
Field Summary
Fields Modifier and Type Field Description static int
METRICS_SIZE
Size of serialized node metrics.
-
Constructor Summary
Constructors Constructor Description ClusterMetricsSnapshot()
Create empty snapshot.ClusterMetricsSnapshot(ClusterGroup p)
Create metrics for given cluster group.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClusterMetrics
deserialize(byte[] data, int off)
De-serializes node metrics.float
getAverageActiveJobs()
Gets average number of active jobs concurrently executing on the node.float
getAverageCancelledJobs()
Gets average number of cancelled jobs this node ever had running concurrently.double
getAverageCpuLoad()
Gets average of CPU load values over all metrics kept in the history.double
getAverageJobExecuteTime()
Gets average time a job takes to execute on the node.double
getAverageJobWaitTime()
Gets average time jobs spend waiting in the queue to be executed.float
getAverageRejectedJobs()
Gets average number of jobs this node rejects during collision resolution operations.float
getAverageWaitingJobs()
Gets average number of waiting jobs this node had queued.float
getBusyTimePercentage()
Gets percentage of time this node is busy executing jobs vs. idling.int
getCurrentActiveJobs()
Gets number of currently active jobs concurrently executing on the node.int
getCurrentCancelledJobs()
Gets number of cancelled jobs that are still running.double
getCurrentCpuLoad()
Returns the CPU usage in[0, 1]
range.int
getCurrentDaemonThreadCount()
Returns the current number of live daemon threads.double
getCurrentGcCpuLoad()
Returns average time spent in CG since the last update.long
getCurrentIdleTime()
Gets time this node spend idling since executing last job.long
getCurrentJobExecuteTime()
Gets longest time a current job has been executing for.long
getCurrentJobWaitTime()
Gets current time an oldest jobs has spent waiting to be executed.long
getCurrentPmeDuration()
Gets execution duration for current partition map exchange in milliseconds.int
getCurrentRejectedJobs()
Gets number of jobs rejected after more recent collision resolution operation.int
getCurrentThreadCount()
Returns the current number of live threads including both daemon and non-daemon threads.int
getCurrentWaitingJobs()
Gets number of queued jobs currently waiting to be executed.long
getHeapMemoryCommitted()
Returns the amount of heap memory in bytes that is committed for the JVM to use.long
getHeapMemoryInitialized()
Returns the amount of heap memory in bytes that the JVM initially requests from the operating system for memory management.long
getHeapMemoryMaximum()
Returns the maximum amount of heap memory in bytes that can be used for memory management.long
getHeapMemoryTotal()
Returns the total amount of heap memory in bytes.long
getHeapMemoryUsed()
Returns the current heap size that is used for object allocation.float
getIdleTimePercentage()
Gets percentage of time this node is idling vs. executing jobs.long
getLastDataVersion()
In-Memory Data Grid assigns incremental versions to all cache operations.long
getLastUpdateTime()
Gets last update time of this node metrics.int
getMaximumActiveJobs()
Gets maximum number of jobs that ever ran concurrently on this node.int
getMaximumCancelledJobs()
Gets maximum number of cancelled jobs this node ever had running concurrently.long
getMaximumJobExecuteTime()
Gets time it took to execute the longest job on the node.long
getMaximumJobWaitTime()
Gets maximum time a job ever spent waiting in a queue to be executed.int
getMaximumRejectedJobs()
Gets maximum number of jobs rejected at once during a single collision resolution operation.int
getMaximumThreadCount()
Returns the maximum live thread count since the JVM started or peak was reset.int
getMaximumWaitingJobs()
Gets maximum number of waiting jobs this node had.long
getNodeStartTime()
Returns the start time of grid node in milliseconds.long
getNonHeapMemoryCommitted()
Returns the amount of non-heap memory in bytes that is committed for the JVM to use.long
getNonHeapMemoryInitialized()
Returns the amount of non-heap memory in bytes that the JVM initially requests from the operating system for memory management.long
getNonHeapMemoryMaximum()
Returns the maximum amount of non-heap memory in bytes that can be used for memory management.long
getNonHeapMemoryTotal()
Returns the total amount of non-heap memory in bytes that can be used for memory management.long
getNonHeapMemoryUsed()
Returns the current non-heap memory size that is used by Java VM.int
getOutboundMessagesQueueSize()
Gets outbound messages queue size.long
getReceivedBytesCount()
Gets received bytes count.int
getReceivedMessagesCount()
Gets received messages count.long
getSentBytesCount()
Gets sent bytes count.int
getSentMessagesCount()
Gets sent messages count.long
getStartTime()
Returns the start time of the JVM in milliseconds.long
getTotalBusyTime()
Gets total time this node spent executing jobs.int
getTotalCancelledJobs()
Gets number of cancelled jobs since node startup.int
getTotalCpus()
Returns the number of CPUs available to the Java Virtual Machine.int
getTotalExecutedJobs()
Gets total number of jobs handled by the node since node startup.int
getTotalExecutedTasks()
Gets total number of tasks handled by the node.long
getTotalIdleTime()
Gets total time this node spent idling (not executing any jobs).long
getTotalJobsExecutionTime()
Gets total time all finished jobs takes to execute on the node since node startup.int
getTotalNodes()
Gets total number of nodes.int
getTotalRejectedJobs()
Gets total number of jobs this node rejects during collision resolution operations since node startup.long
getTotalStartedThreadCount()
Returns the total number of threads created and also started since the JVM started.long
getUpTime()
Returns the uptime of the JVM in milliseconds.static int
serialize(byte[] data, int off, ClusterMetrics metrics)
Serializes node metrics into byte array.static byte[]
serialize(ClusterMetrics metrics)
Serializes node metrics into byte array.void
setAvailableProcessors(int availProcs)
Sets available processors.void
setAverageActiveJobs(float avgActiveJobs)
Sets average active jobs.void
setAverageCancelledJobs(float avgCancelledJobs)
Sets average cancelled jobs.void
setAverageCpuLoad(double avgLoad)
Sets CPU load average over the metrics history.void
setAverageJobExecuteTime(double avgJobExecTime)
Sets average job execution time.void
setAverageJobWaitTime(double avgJobWaitTime)
Sets average job wait time.void
setAverageRejectedJobs(float avgRejectedJobs)
void
setAverageWaitingJobs(float avgWaitingJobs)
Sets average waiting jobs.void
setCurrentActiveJobs(int curActiveJobs)
Sets current active jobs.void
setCurrentCancelledJobs(int curCancelledJobs)
Sets current cancelled jobs.void
setCurrentCpuLoad(double load)
Sets current CPU load.void
setCurrentDaemonThreadCount(int daemonThreadCnt)
Sets daemon thread count.void
setCurrentGcCpuLoad(double gcLoad)
Sets current GC load.void
setCurrentIdleTime(long curIdleTime)
Sets time elapsed since execution of last job.void
setCurrentJobExecuteTime(long curJobExecTime)
Sets current job execute time.void
setCurrentJobWaitTime(long curJobWaitTime)
Sets current job wait time.void
setCurrentPmeDuration(long currentPmeDuration)
Sets execution duration for current partition map exchange.void
setCurrentRejectedJobs(int curRejectedJobs)
void
setCurrentThreadCount(int threadCnt)
Sets thread count.void
setCurrentWaitingJobs(int curWaitingJobs)
Sets current waiting jobs.void
setHeapMemoryCommitted(long heapCommitted)
Sets committed heap memory.void
setHeapMemoryInitialized(long heapInit)
Sets heap initial memory.void
setHeapMemoryMaximum(long heapMax)
Sets maximum possible heap memory.void
setHeapMemoryTotal(long heapTotal)
Sets total heap size.void
setHeapMemoryUsed(long heapUsed)
Sets used heap memory.void
setLastDataVersion(long lastDataVer)
Sets last data version.void
setLastUpdateTime(long lastUpdateTime)
Sets last update time.void
setMaximumActiveJobs(int maxActiveJobs)
Sets max active jobs.void
setMaximumCancelledJobs(int maxCancelledJobs)
Sets maximum cancelled jobs.void
setMaximumJobExecuteTime(long maxJobExecTime)
Sets maximum job execution time.void
setMaximumJobWaitTime(long maxJobWaitTime)
Sets max job wait time.void
setMaximumRejectedJobs(int maxRejectedJobs)
void
setMaximumThreadCount(int peakThreadCnt)
Sets peak thread count.void
setMaximumWaitingJobs(int maxWaitingJobs)
Sets maximum waiting jobs.void
setNodeStartTime(long nodeStartTime)
Sets node start time.void
setNonHeapMemoryCommitted(long nonHeapCommitted)
Sets committed non-heap memory.void
setNonHeapMemoryInitialized(long nonHeapInit)
Sets initial non-heap memory.void
setNonHeapMemoryMaximum(long nonHeapMax)
Sets maximum possible non-heap memory.void
setNonHeapMemoryTotal(long nonHeapTotal)
Sets non-heap total heap size.void
setNonHeapMemoryUsed(long nonHeapUsed)
Sets used non-heap memory.void
setOutboundMessagesQueueSize(int outMesQueueSize)
Sets outbound messages queue size.void
setReceivedBytesCount(long rcvdBytesCnt)
Sets received bytes count.void
setReceivedMessagesCount(int rcvdMsgsCnt)
Sets received messages count.void
setSentBytesCount(long sentBytesCnt)
Sets sent bytes count.void
setSentMessagesCount(int sentMsgsCnt)
Sets sent messages count.void
setStartTime(long startTime)
Sets VM start time.void
setTotalCancelledJobs(int totalCancelledJobs)
Sets total cancelled jobs.void
setTotalExecutedJobs(int totalExecutedJobs)
Sets total active jobs.void
setTotalExecutedTasks(int totalExecTasks)
Sets total executed tasks count.void
setTotalIdleTime(long totalIdleTime)
Set total node idle time.void
setTotalJobsExecutionTime(long totalJobsExecTime)
Sets total jobs execution time.void
setTotalNodes(int totalNodes)
Sets total number of nodes.void
setTotalRejectedJobs(int totalRejectedJobs)
void
setTotalStartedThreadCount(long startedThreadCnt)
Sets started thread count.void
setUpTime(long upTime)
Sets VM up time.String
toString()
-
-
-
Field Detail
-
METRICS_SIZE
public static final int METRICS_SIZE
Size of serialized node metrics.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClusterMetricsSnapshot
public ClusterMetricsSnapshot()
Create empty snapshot.
-
ClusterMetricsSnapshot
public ClusterMetricsSnapshot(ClusterGroup p)
Create metrics for given cluster group.- Parameters:
p
- Projection to get metrics for.
-
-
Method Detail
-
getHeapMemoryTotal
public long getHeapMemoryTotal()
Returns the total amount of heap memory in bytes. This method returns-1
if the total memory size is undefined.This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The JVM may fail to allocate memory even if the amount of used memory does not exceed this maximum size.
This value represents a setting of the heap memory for Java VM and is not a sum of all initial heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getHeapMemoryTotal
in interfaceClusterMetrics
- Returns:
- The total amount of memory in bytes;
-1
if undefined.
-
setHeapMemoryTotal
public void setHeapMemoryTotal(long heapTotal)
Sets total heap size.- Parameters:
heapTotal
- Total heap.
-
setNonHeapMemoryTotal
public void setNonHeapMemoryTotal(long nonHeapTotal)
Sets non-heap total heap size.- Parameters:
nonHeapTotal
- Total heap.
-
getLastUpdateTime
public long getLastUpdateTime()
Gets last update time of this node metrics.- Specified by:
getLastUpdateTime
in interfaceClusterMetrics
- Returns:
- Last update time.
-
setLastUpdateTime
public void setLastUpdateTime(long lastUpdateTime)
Sets last update time.- Parameters:
lastUpdateTime
- Last update time.
-
getMaximumActiveJobs
public int getMaximumActiveJobs()
Gets maximum number of jobs that ever ran concurrently on this node. Note that this different fromClusterMetrics.getTotalExecutedJobs()
metric and only reflects maximum number of jobs that ran at the same time.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getMaximumActiveJobs
in interfaceClusterMetrics
- Returns:
- Maximum number of jobs that ever ran concurrently on this node.
-
setMaximumActiveJobs
public void setMaximumActiveJobs(int maxActiveJobs)
Sets max active jobs.- Parameters:
maxActiveJobs
- Max active jobs.
-
getCurrentActiveJobs
public int getCurrentActiveJobs()
Gets number of currently active jobs concurrently executing on the node.- Specified by:
getCurrentActiveJobs
in interfaceClusterMetrics
- Returns:
- Number of currently active jobs concurrently executing on the node.
-
setCurrentActiveJobs
public void setCurrentActiveJobs(int curActiveJobs)
Sets current active jobs.- Parameters:
curActiveJobs
- Current active jobs.
-
getAverageActiveJobs
public float getAverageActiveJobs()
Gets average number of active jobs concurrently executing on the node.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageActiveJobs
in interfaceClusterMetrics
- Returns:
- Average number of active jobs.
-
setAverageActiveJobs
public void setAverageActiveJobs(float avgActiveJobs)
Sets average active jobs.- Parameters:
avgActiveJobs
- Average active jobs.
-
getMaximumWaitingJobs
public int getMaximumWaitingJobs()
Gets maximum number of waiting jobs this node had.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getMaximumWaitingJobs
in interfaceClusterMetrics
- Returns:
- Maximum number of waiting jobs.
-
setMaximumWaitingJobs
public void setMaximumWaitingJobs(int maxWaitingJobs)
Sets maximum waiting jobs.- Parameters:
maxWaitingJobs
- Maximum waiting jobs.
-
getCurrentWaitingJobs
public int getCurrentWaitingJobs()
Gets number of queued jobs currently waiting to be executed.- Specified by:
getCurrentWaitingJobs
in interfaceClusterMetrics
- Returns:
- Number of queued jobs currently waiting to be executed.
-
setCurrentWaitingJobs
public void setCurrentWaitingJobs(int curWaitingJobs)
Sets current waiting jobs.- Parameters:
curWaitingJobs
- Current waiting jobs.
-
getAverageWaitingJobs
public float getAverageWaitingJobs()
Gets average number of waiting jobs this node had queued.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageWaitingJobs
in interfaceClusterMetrics
- Returns:
- Average number of waiting jobs.
-
setAverageWaitingJobs
public void setAverageWaitingJobs(float avgWaitingJobs)
Sets average waiting jobs.- Parameters:
avgWaitingJobs
- Average waiting jobs.
-
getMaximumRejectedJobs
public int getMaximumRejectedJobs()
Gets maximum number of jobs rejected at once during a single collision resolution operation.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getMaximumRejectedJobs
in interfaceClusterMetrics
- Returns:
- Maximum number of jobs rejected at once.
-
setMaximumRejectedJobs
public void setMaximumRejectedJobs(int maxRejectedJobs)
- Parameters:
maxRejectedJobs
- Maximum number of jobs rejected during a single collision resolution event.
-
getCurrentRejectedJobs
public int getCurrentRejectedJobs()
Gets number of jobs rejected after more recent collision resolution operation.- Specified by:
getCurrentRejectedJobs
in interfaceClusterMetrics
- Returns:
- Number of jobs rejected after more recent collision resolution operation.
-
setCurrentRejectedJobs
public void setCurrentRejectedJobs(int curRejectedJobs)
- Parameters:
curRejectedJobs
- Number of jobs rejected during most recent collision resolution.
-
getAverageRejectedJobs
public float getAverageRejectedJobs()
Gets average number of jobs this node rejects during collision resolution operations.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of grid configuration settings:
- Specified by:
getAverageRejectedJobs
in interfaceClusterMetrics
- Returns:
- Average number of jobs this node rejects during collision resolution operations.
-
setAverageRejectedJobs
public void setAverageRejectedJobs(float avgRejectedJobs)
- Parameters:
avgRejectedJobs
- Average number of jobs this node rejects.
-
getTotalRejectedJobs
public int getTotalRejectedJobs()
Gets total number of jobs this node rejects during collision resolution operations since node startup.Note: Unlike most of other aggregation metrics this metric is not calculated over history but over the entire node life.
- Specified by:
getTotalRejectedJobs
in interfaceClusterMetrics
- Returns:
- Total number of jobs this node rejects during collision resolution operations since node startup.
-
setTotalRejectedJobs
public void setTotalRejectedJobs(int totalRejectedJobs)
- Parameters:
totalRejectedJobs
- Total number of jobs this node ever rejected.
-
getMaximumCancelledJobs
public int getMaximumCancelledJobs()
Gets maximum number of cancelled jobs this node ever had running concurrently.- Specified by:
getMaximumCancelledJobs
in interfaceClusterMetrics
- Returns:
- Maximum number of cancelled jobs.
-
setMaximumCancelledJobs
public void setMaximumCancelledJobs(int maxCancelledJobs)
Sets maximum cancelled jobs.- Parameters:
maxCancelledJobs
- Maximum cancelled jobs.
-
getCurrentCancelledJobs
public int getCurrentCancelledJobs()
Gets number of cancelled jobs that are still running. Just like regular java threads, jobs will receive cancel notification, but it's ultimately up to the job itself to gracefully exit.- Specified by:
getCurrentCancelledJobs
in interfaceClusterMetrics
- Returns:
- Number of cancelled jobs that are still running.
-
setCurrentCancelledJobs
public void setCurrentCancelledJobs(int curCancelledJobs)
Sets current cancelled jobs.- Parameters:
curCancelledJobs
- Current cancelled jobs.
-
getAverageCancelledJobs
public float getAverageCancelledJobs()
Gets average number of cancelled jobs this node ever had running concurrently.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageCancelledJobs
in interfaceClusterMetrics
- Returns:
- Average number of cancelled jobs.
-
setAverageCancelledJobs
public void setAverageCancelledJobs(float avgCancelledJobs)
Sets average cancelled jobs.- Parameters:
avgCancelledJobs
- Average cancelled jobs.
-
getTotalExecutedJobs
public int getTotalExecutedJobs()
Gets total number of jobs handled by the node since node startup.Note: Unlike most of other aggregation metrics this metric is not calculated over history but over the entire node life.
- Specified by:
getTotalExecutedJobs
in interfaceClusterMetrics
- Returns:
- Total number of jobs handled by the node since node startup.
-
setTotalExecutedJobs
public void setTotalExecutedJobs(int totalExecutedJobs)
Sets total active jobs.- Parameters:
totalExecutedJobs
- Total active jobs.
-
getTotalJobsExecutionTime
public long getTotalJobsExecutionTime()
Gets total time all finished jobs takes to execute on the node since node startup.Note: Unlike most of other aggregation metrics this metric is not calculated over history but over the entire node life.
- Specified by:
getTotalJobsExecutionTime
in interfaceClusterMetrics
- Returns:
- Total jobs execution time.
-
setTotalJobsExecutionTime
public void setTotalJobsExecutionTime(long totalJobsExecTime)
Sets total jobs execution time.- Parameters:
totalJobsExecTime
- Total jobs execution time.
-
getTotalCancelledJobs
public int getTotalCancelledJobs()
Gets number of cancelled jobs since node startup.Note: Unlike most of other aggregation metrics this metric is not calculated over history but over the entire node life.
- Specified by:
getTotalCancelledJobs
in interfaceClusterMetrics
- Returns:
- Total number of cancelled jobs since node startup.
-
setTotalCancelledJobs
public void setTotalCancelledJobs(int totalCancelledJobs)
Sets total cancelled jobs.- Parameters:
totalCancelledJobs
- Total cancelled jobs.
-
getMaximumJobWaitTime
public long getMaximumJobWaitTime()
Gets maximum time a job ever spent waiting in a queue to be executed.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getMaximumJobWaitTime
in interfaceClusterMetrics
- Returns:
- Maximum waiting time.
-
setMaximumJobWaitTime
public void setMaximumJobWaitTime(long maxJobWaitTime)
Sets max job wait time.- Parameters:
maxJobWaitTime
- Max job wait time.
-
getCurrentJobWaitTime
public long getCurrentJobWaitTime()
Gets current time an oldest jobs has spent waiting to be executed.- Specified by:
getCurrentJobWaitTime
in interfaceClusterMetrics
- Returns:
- Current wait time of oldest job.
-
setCurrentJobWaitTime
public void setCurrentJobWaitTime(long curJobWaitTime)
Sets current job wait time.- Parameters:
curJobWaitTime
- Current job wait time.
-
getAverageJobWaitTime
public double getAverageJobWaitTime()
Gets average time jobs spend waiting in the queue to be executed.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageJobWaitTime
in interfaceClusterMetrics
- Returns:
- Average job wait time.
-
setAverageJobWaitTime
public void setAverageJobWaitTime(double avgJobWaitTime)
Sets average job wait time.- Parameters:
avgJobWaitTime
- Average job wait time.
-
getMaximumJobExecuteTime
public long getMaximumJobExecuteTime()
Gets time it took to execute the longest job on the node.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getMaximumJobExecuteTime
in interfaceClusterMetrics
- Returns:
- Time it took to execute the longest job on the node.
-
setMaximumJobExecuteTime
public void setMaximumJobExecuteTime(long maxJobExecTime)
Sets maximum job execution time.- Parameters:
maxJobExecTime
- Maximum job execution time.
-
getCurrentJobExecuteTime
public long getCurrentJobExecuteTime()
Gets longest time a current job has been executing for.- Specified by:
getCurrentJobExecuteTime
in interfaceClusterMetrics
- Returns:
- Longest time a current job has been executing for.
-
setCurrentJobExecuteTime
public void setCurrentJobExecuteTime(long curJobExecTime)
Sets current job execute time.- Parameters:
curJobExecTime
- Current job execute time.
-
getAverageJobExecuteTime
public double getAverageJobExecuteTime()
Gets average time a job takes to execute on the node.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageJobExecuteTime
in interfaceClusterMetrics
- Returns:
- Average job execution time.
-
setAverageJobExecuteTime
public void setAverageJobExecuteTime(double avgJobExecTime)
Sets average job execution time.- Parameters:
avgJobExecTime
- Average job execution time.
-
getTotalExecutedTasks
public int getTotalExecutedTasks()
Gets total number of tasks handled by the node.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getTotalExecutedTasks
in interfaceClusterMetrics
- Returns:
- Total number of jobs handled by the node.
-
setTotalExecutedTasks
public void setTotalExecutedTasks(int totalExecTasks)
Sets total executed tasks count.- Parameters:
totalExecTasks
- total executed tasks count.
-
getTotalBusyTime
public long getTotalBusyTime()
Gets total time this node spent executing jobs.- Specified by:
getTotalBusyTime
in interfaceClusterMetrics
- Returns:
- Total time this node spent executing jobs.
-
getTotalIdleTime
public long getTotalIdleTime()
Gets total time this node spent idling (not executing any jobs).- Specified by:
getTotalIdleTime
in interfaceClusterMetrics
- Returns:
- Gets total time this node spent idling.
-
setTotalIdleTime
public void setTotalIdleTime(long totalIdleTime)
Set total node idle time.- Parameters:
totalIdleTime
- Total node idle time.
-
getCurrentIdleTime
public long getCurrentIdleTime()
Gets time this node spend idling since executing last job.- Specified by:
getCurrentIdleTime
in interfaceClusterMetrics
- Returns:
- Time this node spend idling since executing last job.
-
setCurrentIdleTime
public void setCurrentIdleTime(long curIdleTime)
Sets time elapsed since execution of last job.- Parameters:
curIdleTime
- Time elapsed since execution of last job.
-
getBusyTimePercentage
public float getBusyTimePercentage()
Gets percentage of time this node is busy executing jobs vs. idling.- Specified by:
getBusyTimePercentage
in interfaceClusterMetrics
- Returns:
- Percentage of time this node is busy (value is less than
or equal to
1
and greater than or equal to0
)
-
getIdleTimePercentage
public float getIdleTimePercentage()
Gets percentage of time this node is idling vs. executing jobs.- Specified by:
getIdleTimePercentage
in interfaceClusterMetrics
- Returns:
- Percentage of time this node is idle (value is less than
or equal to
1
and greater than or equal to0
)
-
getTotalCpus
public int getTotalCpus()
Returns the number of CPUs available to the Java Virtual Machine. This method is equivalent to theRuntime.availableProcessors()
method.Note that this value may change during successive invocations of the virtual machine.
- Specified by:
getTotalCpus
in interfaceClusterMetrics
- Returns:
- The number of processors available to the virtual machine, never smaller than one.
-
getCurrentCpuLoad
public double getCurrentCpuLoad()
Returns the CPU usage in[0, 1]
range. The exact way how this number is calculated depends on SPI implementation.If the CPU usage is not available, a negative value is returned.
This method is designed to provide a hint about the system load and may be queried frequently. The load average may be unavailable on some platform where it is expensive to implement this method.
- Specified by:
getCurrentCpuLoad
in interfaceClusterMetrics
- Returns:
- The estimated CPU usage in
[0, 1]
range. Negative value if not available.
-
getAverageCpuLoad
public double getAverageCpuLoad()
Gets average of CPU load values over all metrics kept in the history.Note: all aggregated metrics like average, minimum, maximum, total, count are calculated over all the metrics kept in history. The history size is set via either one or both of configuration settings:
- Specified by:
getAverageCpuLoad
in interfaceClusterMetrics
- Returns:
- Average of CPU load value in
[0, 1]
range over all metrics kept in the history.
-
getCurrentGcCpuLoad
public double getCurrentGcCpuLoad()
Returns average time spent in CG since the last update.- Specified by:
getCurrentGcCpuLoad
in interfaceClusterMetrics
- Returns:
- Average time spent in CG since the last update.
-
getHeapMemoryInitialized
public long getHeapMemoryInitialized()
Returns the amount of heap memory in bytes that the JVM initially requests from the operating system for memory management. This method returns-1
if the initial memory size is undefined.This value represents a setting of the heap memory for Java VM and is not a sum of all initial heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getHeapMemoryInitialized
in interfaceClusterMetrics
- Returns:
- The initial size of memory in bytes;
-1
if undefined.
-
getHeapMemoryUsed
public long getHeapMemoryUsed()
Returns the current heap size that is used for object allocation. The heap consists of one or more memory pools. This value is the sum ofused
heap memory values of all heap memory pools.The amount of used memory in the returned is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getHeapMemoryUsed
in interfaceClusterMetrics
- Returns:
- Amount of heap memory used.
-
getHeapMemoryCommitted
public long getHeapMemoryCommitted()
Returns the amount of heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM to use. The heap consists of one or more memory pools. This value is the sum ofcommitted
heap memory values of all heap memory pools.Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getHeapMemoryCommitted
in interfaceClusterMetrics
- Returns:
- The amount of committed memory in bytes.
-
getHeapMemoryMaximum
public long getHeapMemoryMaximum()
Returns the maximum amount of heap memory in bytes that can be used for memory management. This method returns-1
if the maximum memory size is undefined.This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The JVM may fail to allocate memory even if the amount of used memory does not exceed this maximum size.
This value represents a setting of the heap memory for Java VM and is not a sum of all initial heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getHeapMemoryMaximum
in interfaceClusterMetrics
- Returns:
- The maximum amount of memory in bytes;
-1
if undefined.
-
getNonHeapMemoryInitialized
public long getNonHeapMemoryInitialized()
Returns the amount of non-heap memory in bytes that the JVM initially requests from the operating system for memory management. This method returns-1
if the initial memory size is undefined.This value represents a setting of non-heap memory for Java VM and is not a sum of all initial heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getNonHeapMemoryInitialized
in interfaceClusterMetrics
- Returns:
- The initial size of memory in bytes;
-1
if undefined.
-
getNonHeapMemoryUsed
public long getNonHeapMemoryUsed()
Returns the current non-heap memory size that is used by Java VM. The non-heap memory consists of one or more memory pools. This value is the sum ofused
non-heap memory values of all non-heap memory pools.Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getNonHeapMemoryUsed
in interfaceClusterMetrics
- Returns:
- Amount of none-heap memory used.
-
getNonHeapMemoryCommitted
public long getNonHeapMemoryCommitted()
Returns the amount of non-heap memory in bytes that is committed for the JVM to use. This amount of memory is guaranteed for the JVM to use. The non-heap memory consists of one or more memory pools. This value is the sum ofcommitted
non-heap memory values of all non-heap memory pools.Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getNonHeapMemoryCommitted
in interfaceClusterMetrics
- Returns:
- The amount of committed memory in bytes.
-
getNonHeapMemoryMaximum
public long getNonHeapMemoryMaximum()
Returns the maximum amount of non-heap memory in bytes that can be used for memory management. This method returns-1
if the maximum memory size is undefined.This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The JVM may fail to allocate memory even if the amount of used memory does not exceed this maximum size.
This value represents a setting of the non-heap memory for Java VM and is not a sum of all initial non-heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getNonHeapMemoryMaximum
in interfaceClusterMetrics
- Returns:
- The maximum amount of memory in bytes;
-1
if undefined.
-
getNonHeapMemoryTotal
public long getNonHeapMemoryTotal()
Returns the total amount of non-heap memory in bytes that can be used for memory management. This method returns-1
if the total memory size is undefined.This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The JVM may fail to allocate memory even if the amount of used memory does not exceed this maximum size.
This value represents a setting of the non-heap memory for Java VM and is not a sum of all initial non-heap values for all memory pools.
Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getNonHeapMemoryTotal
in interfaceClusterMetrics
- Returns:
- The total amount of memory in bytes;
-1
if undefined.
-
getUpTime
public long getUpTime()
Returns the uptime of the JVM in milliseconds.- Specified by:
getUpTime
in interfaceClusterMetrics
- Returns:
- Uptime of the JVM in milliseconds.
-
getStartTime
public long getStartTime()
Returns the start time of the JVM in milliseconds. This method returns the approximate time when the Java virtual machine started.- Specified by:
getStartTime
in interfaceClusterMetrics
- Returns:
- Start time of the JVM in milliseconds.
-
getNodeStartTime
public long getNodeStartTime()
Returns the start time of grid node in milliseconds. There can be several grid nodes started in one JVM, so JVM start time will be the same for all of them, but node start time will be different.- Specified by:
getNodeStartTime
in interfaceClusterMetrics
- Returns:
- Start time of the grid node in milliseconds.
-
getCurrentThreadCount
public int getCurrentThreadCount()
Returns the current number of live threads including both daemon and non-daemon threads.- Specified by:
getCurrentThreadCount
in interfaceClusterMetrics
- Returns:
- Current number of live threads.
-
getMaximumThreadCount
public int getMaximumThreadCount()
Returns the maximum live thread count since the JVM started or peak was reset.Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getMaximumThreadCount
in interfaceClusterMetrics
- Returns:
- The peak live thread count.
-
getTotalStartedThreadCount
public long getTotalStartedThreadCount()
Returns the total number of threads created and also started since the JVM started.Note: this is not an aggregated metric and it's calculated from the time of the node's startup.
- Specified by:
getTotalStartedThreadCount
in interfaceClusterMetrics
- Returns:
- The total number of threads started.
-
getCurrentDaemonThreadCount
public int getCurrentDaemonThreadCount()
Returns the current number of live daemon threads.- Specified by:
getCurrentDaemonThreadCount
in interfaceClusterMetrics
- Returns:
- Current number of live daemon threads.
-
getLastDataVersion
public long getLastDataVersion()
In-Memory Data Grid assigns incremental versions to all cache operations. This method provides the latest data version on the node.- Specified by:
getLastDataVersion
in interfaceClusterMetrics
- Returns:
- Last data version.
-
getSentMessagesCount
public int getSentMessagesCount()
Gets sent messages count.- Specified by:
getSentMessagesCount
in interfaceClusterMetrics
- Returns:
- Sent messages count.
-
getSentBytesCount
public long getSentBytesCount()
Gets sent bytes count.- Specified by:
getSentBytesCount
in interfaceClusterMetrics
- Returns:
- Sent bytes count.
-
getReceivedMessagesCount
public int getReceivedMessagesCount()
Gets received messages count.- Specified by:
getReceivedMessagesCount
in interfaceClusterMetrics
- Returns:
- Received messages count.
-
getReceivedBytesCount
public long getReceivedBytesCount()
Gets received bytes count.- Specified by:
getReceivedBytesCount
in interfaceClusterMetrics
- Returns:
- Received bytes count.
-
getOutboundMessagesQueueSize
public int getOutboundMessagesQueueSize()
Gets outbound messages queue size.- Specified by:
getOutboundMessagesQueueSize
in interfaceClusterMetrics
- Returns:
- Outbound messages queue size.
-
getTotalNodes
public int getTotalNodes()
Gets total number of nodes.- Specified by:
getTotalNodes
in interfaceClusterMetrics
- Returns:
- Total number of nodes.
-
getCurrentPmeDuration
public long getCurrentPmeDuration()
Gets execution duration for current partition map exchange in milliseconds.- Specified by:
getCurrentPmeDuration
in interfaceClusterMetrics
- Returns:
- Gets execution duration for current partition map exchange in milliseconds.
0
if there is no running PME.
-
setAvailableProcessors
public void setAvailableProcessors(int availProcs)
Sets available processors.- Parameters:
availProcs
- Available processors.
-
setCurrentCpuLoad
public void setCurrentCpuLoad(double load)
Sets current CPU load.- Parameters:
load
- Current CPU load.
-
setAverageCpuLoad
public void setAverageCpuLoad(double avgLoad)
Sets CPU load average over the metrics history.- Parameters:
avgLoad
- CPU load average.
-
setCurrentGcCpuLoad
public void setCurrentGcCpuLoad(double gcLoad)
Sets current GC load.- Parameters:
gcLoad
- Current GC load.
-
setHeapMemoryInitialized
public void setHeapMemoryInitialized(long heapInit)
Sets heap initial memory.- Parameters:
heapInit
- Heap initial memory.
-
setHeapMemoryUsed
public void setHeapMemoryUsed(long heapUsed)
Sets used heap memory.- Parameters:
heapUsed
- Used heap memory.
-
setHeapMemoryCommitted
public void setHeapMemoryCommitted(long heapCommitted)
Sets committed heap memory.- Parameters:
heapCommitted
- Committed heap memory.
-
setHeapMemoryMaximum
public void setHeapMemoryMaximum(long heapMax)
Sets maximum possible heap memory.- Parameters:
heapMax
- Maximum possible heap memory.
-
setNonHeapMemoryInitialized
public void setNonHeapMemoryInitialized(long nonHeapInit)
Sets initial non-heap memory.- Parameters:
nonHeapInit
- Initial non-heap memory.
-
setNonHeapMemoryUsed
public void setNonHeapMemoryUsed(long nonHeapUsed)
Sets used non-heap memory.- Parameters:
nonHeapUsed
- Used non-heap memory.
-
setNonHeapMemoryCommitted
public void setNonHeapMemoryCommitted(long nonHeapCommitted)
Sets committed non-heap memory.- Parameters:
nonHeapCommitted
- Committed non-heap memory.
-
setNonHeapMemoryMaximum
public void setNonHeapMemoryMaximum(long nonHeapMax)
Sets maximum possible non-heap memory.- Parameters:
nonHeapMax
- Maximum possible non-heap memory.
-
setUpTime
public void setUpTime(long upTime)
Sets VM up time.- Parameters:
upTime
- VM up time.
-
setStartTime
public void setStartTime(long startTime)
Sets VM start time.- Parameters:
startTime
- VM start time.
-
setNodeStartTime
public void setNodeStartTime(long nodeStartTime)
Sets node start time.- Parameters:
nodeStartTime
- node start time.
-
setCurrentThreadCount
public void setCurrentThreadCount(int threadCnt)
Sets thread count.- Parameters:
threadCnt
- Thread count.
-
setMaximumThreadCount
public void setMaximumThreadCount(int peakThreadCnt)
Sets peak thread count.- Parameters:
peakThreadCnt
- Peak thread count.
-
setTotalStartedThreadCount
public void setTotalStartedThreadCount(long startedThreadCnt)
Sets started thread count.- Parameters:
startedThreadCnt
- Started thread count.
-
setCurrentDaemonThreadCount
public void setCurrentDaemonThreadCount(int daemonThreadCnt)
Sets daemon thread count.- Parameters:
daemonThreadCnt
- Daemon thread count.
-
setLastDataVersion
public void setLastDataVersion(long lastDataVer)
Sets last data version.- Parameters:
lastDataVer
- Last data version.
-
setSentMessagesCount
public void setSentMessagesCount(int sentMsgsCnt)
Sets sent messages count.- Parameters:
sentMsgsCnt
- Sent messages count.
-
setSentBytesCount
public void setSentBytesCount(long sentBytesCnt)
Sets sent bytes count.- Parameters:
sentBytesCnt
- Sent bytes count.
-
setReceivedMessagesCount
public void setReceivedMessagesCount(int rcvdMsgsCnt)
Sets received messages count.- Parameters:
rcvdMsgsCnt
- Received messages count.
-
setReceivedBytesCount
public void setReceivedBytesCount(long rcvdBytesCnt)
Sets received bytes count.- Parameters:
rcvdBytesCnt
- Received bytes count.
-
setOutboundMessagesQueueSize
public void setOutboundMessagesQueueSize(int outMesQueueSize)
Sets outbound messages queue size.- Parameters:
outMesQueueSize
- Outbound messages queue size.
-
setTotalNodes
public void setTotalNodes(int totalNodes)
Sets total number of nodes.- Parameters:
totalNodes
- Total number of nodes.
-
setCurrentPmeDuration
public void setCurrentPmeDuration(long currentPmeDuration)
Sets execution duration for current partition map exchange.- Parameters:
currentPmeDuration
- Execution duration for current partition map exchange.
-
serialize
public static byte[] serialize(ClusterMetrics metrics)
Serializes node metrics into byte array.- Parameters:
metrics
- Node metrics to serialize.- Returns:
- New offset.
-
serialize
public static int serialize(byte[] data, int off, ClusterMetrics metrics)
Serializes node metrics into byte array.- Parameters:
data
- Byte array.off
- Offset into byte array.metrics
- Node metrics to serialize.- Returns:
- New offset.
-
deserialize
public static ClusterMetrics deserialize(byte[] data, int off)
De-serializes node metrics.- Parameters:
data
- Byte array.off
- Offset into byte array.- Returns:
- Deserialized node metrics.
-
-