@Deprecated public class Stats extends Object
Stats is responsible for calculating the load and health of a given server. It uses tomcat's status servlet results. A schema was generated for the XML output and JAXB was used to generate classes.
The equations are:
memory weight = (int)(50 * (free/max))
thread weight = (int)(50 * (current/max))
The load factors are stored in the properties files. Simply change the values in the properties to change how load is calculated. The defaults values are memory (50) and threads (50). The sum of the factors must equal 100.
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE
Deprecated.
|
static double |
ACTIVE_PER
Deprecated.
|
static int |
DEAD
Deprecated.
|
static int |
DEFAULT_MEMORY_FACTOR
Deprecated.
|
static int |
DEFAULT_THREAD_FACTOR
Deprecated.
|
static int |
HEALTHY
Deprecated.
|
static double |
HEALTHY_PER
Deprecated.
|
static int |
WARNING
Deprecated.
|
static double |
WARNING_PER
Deprecated.
|
Constructor and Description |
---|
Stats()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static int |
calculateLoad(Status stat)
Deprecated.
The method is responsible for taking a status object and calculating an
int value from 1 to 100.
|
static int |
calculateMemoryLoad(Status stat)
Deprecated.
Method will calculate the memory load: used / max = load.
|
static int |
calculateStatus(Status stat)
Deprecated.
Method should calculate if the server is: dead, active, warning or
healthy.
|
static int |
calculateThreadLoad(Status stat)
Deprecated.
Method will calculate the thread load: busy / max = load.
|
public static final int DEAD
public static final int ACTIVE
public static final int WARNING
public static final int HEALTHY
public static final int DEFAULT_MEMORY_FACTOR
public static final int DEFAULT_THREAD_FACTOR
public static final double HEALTHY_PER
public static final double ACTIVE_PER
public static final double WARNING_PER
public static int calculateLoad(Status stat)
stat
- status information about the serverpublic static int calculateStatus(Status stat)
public static int calculateMemoryLoad(Status stat)
stat
- status information about the jvmpublic static int calculateThreadLoad(Status stat)
stat
- status information about the serverCopyright © 1998-2016 Apache Software Foundation. All Rights Reserved.