Package org.glassfish.admin.monitor.jvm
Class ServerRuntimeStatsProvider
- java.lang.Object
-
- org.glassfish.admin.monitor.jvm.ServerRuntimeStatsProvider
-
@AMXMetadata(type="server-runtime-mon", group="monitoring", isSingleton=true) @ManagedObject @Description("Server Runtime Statistics") public class ServerRuntimeStatsProvider extends Object
Class providing the MBean for server runtime statisticsThe MBean will be of the format
amx:pp=/mon/server-mon[server],type=server-runtime-mon
and can be enabled by turning the Jvm monitoring level in the admin console to LOW
-
-
Field Summary
Fields Modifier and Type Field Description static int
FAILED_STATE
static int
RUNNING_STATE
static int
STARTING_STATE
static int
STOPPED_STATE
static int
STOPPING_STATE
-
Constructor Summary
Constructors Constructor Description ServerRuntimeStatsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getStartTime()
Gets the start time of the Java virtual machinelong
getState()
Gets the state of the server such as Running, Stopped, Failed.long
getUptime()
Gets the uptime of the Java virtual machinevoid
setState(int state)
-
-
-
Field Detail
-
STARTING_STATE
public static final int STARTING_STATE
- See Also:
- Constant Field Values
-
RUNNING_STATE
public static final int RUNNING_STATE
- See Also:
- Constant Field Values
-
STOPPING_STATE
public static final int STOPPING_STATE
- See Also:
- Constant Field Values
-
STOPPED_STATE
public static final int STOPPED_STATE
- See Also:
- Constant Field Values
-
FAILED_STATE
public static final int FAILED_STATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUptime
@ManagedAttribute(id="uptime") @Description("uptime of the Java virtual machine in milliseconds") public long getUptime()
Gets the uptime of the Java virtual machine- Returns:
- time in milliseconds
-
getStartTime
@ManagedAttribute(id="starttime") @Description("start time of the Java virtual machine") public long getStartTime()
Gets the start time of the Java virtual machine- Returns:
- time in milliseconds since the epoch (1st January 1970)
-
getState
@ManagedAttribute(id="state") @Description("state of the server such as Running, Stopped, Failed") public long getState()
Gets the state of the server such as Running, Stopped, Failed.- Returns:
- a number representing the state of the server
- See Also:
STARTING_STATE
,RUNNING_STATE
,STOPPING_STATE
,STOPPED_STATE
,FAILED_STATE
-
setState
public void setState(int state)
-
-