de.zib.scalaris.jmx
Class MonitorService

java.lang.Object
  extended by de.zib.scalaris.jmx.MonitorService
All Implemented Interfaces:
MonitorServiceMBean

public class MonitorService
extends Object
implements MonitorServiceMBean

Provides methods to monitor a specific Scalaris (Erlang) VM via JMX.

Since:
3.15
Version:
3.15
Author:
Nico Kruber, kruber@zib.de

Constructor Summary
MonitorService(String node)
          Creates a connection to the erlang VM of the given Scalaris node.
 
Method Summary
 Double getCurLatencyAvg()
          Gets the current, i.e.
 Double getCurLatencyStddev()
          Gets the current, i.e.
 Map<Long,Double> getLatencyAvg()
          Gets average latency values of the whole Scalaris ring from the VM the monitor is connected to.
 Map<Long,Double> getLatencyStddev()
          Gets the standard deviation of the latency values of the whole Scalaris ring from the VM the monitor is connected to.
 Long getNodes()
          Gets the number of Scalaris nodes of the whole Scalaris ring from the VM the monitor is connected to.
 Long getTotalLoad()
          Gets the total load of the whole Scalaris ring from the VM the monitor is connected to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitorService

public MonitorService(String node)
               throws ConnectionException
Creates a connection to the erlang VM of the given Scalaris node. Uses the connection policy of the global connection factory.

Parameters:
node - Scalaris node to connect with
Throws:
ConnectionException - if the connection fails or the connection policy is not cloneable
Method Detail

getTotalLoad

public Long getTotalLoad()
                  throws ConnectionException,
                         UnknownException
Description copied from interface: MonitorServiceMBean
Gets the total load of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getTotalLoad in interface MonitorServiceMBean
Returns:
number of DHT nodes
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs

getNodes

public Long getNodes()
              throws ConnectionException,
                     UnknownException
Description copied from interface: MonitorServiceMBean
Gets the number of Scalaris nodes of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getNodes in interface MonitorServiceMBean
Returns:
number of DHT nodes
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs

getLatencyAvg

public Map<Long,Double> getLatencyAvg()
                               throws ConnectionException,
                                      UnknownException
Description copied from interface: MonitorServiceMBean
Gets average latency values of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getLatencyAvg in interface MonitorServiceMBean
Returns:
map of timestamps to average latencies
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs

getLatencyStddev

public Map<Long,Double> getLatencyStddev()
                                  throws ConnectionException,
                                         UnknownException
Description copied from interface: MonitorServiceMBean
Gets the standard deviation of the latency values of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getLatencyStddev in interface MonitorServiceMBean
Returns:
map of timestamps to latency (standard) deviation
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs

getCurLatencyAvg

public Double getCurLatencyAvg()
                        throws ConnectionException,
                               UnknownException
Description copied from interface: MonitorServiceMBean
Gets the current, i.e. latest, average latency of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getCurLatencyAvg in interface MonitorServiceMBean
Returns:
latest average latency (or null if there is none)
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs

getCurLatencyStddev

public Double getCurLatencyStddev()
                           throws ConnectionException,
                                  UnknownException
Description copied from interface: MonitorServiceMBean
Gets the current, i.e. latest, standard deviation of the latency of the whole Scalaris ring from the VM the monitor is connected to.

Specified by:
getCurLatencyStddev in interface MonitorServiceMBean
Returns:
latest latency (standard) deviation (or null if there is none)
Throws:
ConnectionException - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
UnknownException - if any other error occurs