info.magnolia.monitoring
Class SystemMonitor

java.lang.Object
  extended by info.magnolia.monitoring.SystemMonitor

public class SystemMonitor
extends Object

Allows to monitor the system.


Field Summary
static long BYTE_TO_MEGABYTE_FACTOR
           
static String MEMORY_LIMIT_IS_REACHED_STRING_FORMAT
           
static int MEMORY_THRESHOLD_IN_MB
           
static int MEMORY_THRESHOLD_PERCENTAGE
           
static String MEMORY_VALUES_STRING_FORMAT
           
 
Constructor Summary
SystemMonitor()
           
 
Method Summary
protected  boolean isBelowAllThresholds(long maxMemoryInMb, long totalMemoryInMb, long freeMemoryInMb)
           
 boolean isMemoryLimitReached()
          Evaluates whether the memory limit is reached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMORY_LIMIT_IS_REACHED_STRING_FORMAT

public static final String MEMORY_LIMIT_IS_REACHED_STRING_FORMAT
See Also:
Constant Field Values

MEMORY_VALUES_STRING_FORMAT

public static final String MEMORY_VALUES_STRING_FORMAT
See Also:
Constant Field Values

BYTE_TO_MEGABYTE_FACTOR

public static final long BYTE_TO_MEGABYTE_FACTOR
See Also:
Constant Field Values

MEMORY_THRESHOLD_PERCENTAGE

public static final int MEMORY_THRESHOLD_PERCENTAGE
See Also:
Constant Field Values

MEMORY_THRESHOLD_IN_MB

public static final int MEMORY_THRESHOLD_IN_MB
See Also:
Constant Field Values
Constructor Detail

SystemMonitor

public SystemMonitor()
Method Detail

isMemoryLimitReached

public boolean isMemoryLimitReached()
Evaluates whether the memory limit is reached. This is the case when system memory is absolutely below MEMORY_THRESHOLD_IN_MB and relatively below MEMORY_THRESHOLD_PERCENTAGE.

Returns:
whether the memory limit is reached or not.

isBelowAllThresholds

protected boolean isBelowAllThresholds(long maxMemoryInMb,
                                       long totalMemoryInMb,
                                       long freeMemoryInMb)
Parameters:
maxMemoryInMb - maximum amount the JVM can grow to
totalMemoryInMb - current size of the JVM
freeMemoryInMb - amount left of the current size


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.