com.bea.wlevs.monitor
Interface Monitor


public interface Monitor
extends Stage, EventSink

The Monitor service allows one to monitor the throughput and latency of Event Server application endpoints. An Event Server endpoint is either the entry or the exit point in an application stage. Clients can register at the Monitor service to receive events in the form of a MetricEvent that indicate the throughput and the latency metric of an endpoint as defined by the interval parameter. Even though the monitoring activities are processed separately from the application events, monitoring still adds some overhead to the system, hence it is disabled by default. To enable monitoring of an stage, a stage must be marked as 'manageable' in the application assembly and then it can be dynamically enabled or disabled for monitoring through the configuration system.

See Also:
Endpoint, Stage, MetricEvent

Field Summary
static java.lang.String CONTROL_STREAM_FILTER
           
static java.lang.String CONTROL_STREAM_ID
           
static java.lang.String SERVICE_FILTER
           
static java.lang.String SERVICE_ID
           
static java.lang.String STREAM_FILTER
           
static java.lang.String STREAM_ID
           
static java.util.concurrent.TimeUnit TIME_UNIT
           
 
Method Summary
 Endpoint createEndpoint(java.lang.String applicationId, java.lang.String stageId, Endpoint.Direction stagepoint)
          Returns endpoint that represents a 'place' in the Event Server that can be monitored.
 boolean isEnabled()
          Returns if the Monitor service is enabled.
 Statement monitorAvgLatency(Endpoint start, Endpoint end, long averageInterval, java.util.concurrent.TimeUnit unit)
          Monitor the average latency of events between two endpoints.
 java.lang.String monitorAvgLatency(Endpoint start, Endpoint end, long averageInterval, java.util.concurrent.TimeUnit unit, EventSink listener)
          Monitor the average latency of events between two endpoints.
 Statement monitorAvgLatencyThreshold(Endpoint start, Endpoint end, long averageInterval, long threshold, java.util.concurrent.TimeUnit unit)
          Monitor if the average latency of events between two endpoints cross a threshold.
 java.lang.String monitorAvgLatencyThreshold(Endpoint start, Endpoint end, long averageInterval, long threshold, java.util.concurrent.TimeUnit unit, EventSink listener)
          Monitor if the average latency of events between two endpoints cross a threshold.
 Statement monitorAvgThroughput(Endpoint endpoint, long throughputInterval, long averageInterval, java.util.concurrent.TimeUnit unit)
          Monitor the average throughput of events in an endpoint.
 java.lang.String monitorAvgThroughput(Endpoint endpoint, long throughputInterval, long averageInterval, java.util.concurrent.TimeUnit unit, EventSink listener)
          Monitor the average throughput of events in an endpoint.
 Statement monitorMaxLatency(Endpoint start, Endpoint end, long maxInterval, java.util.concurrent.TimeUnit unit)
          Monitor the maximum latency of events between two endpoints.
 java.lang.String monitorMaxLatency(Endpoint start, Endpoint end, long averageInterval, java.util.concurrent.TimeUnit unit, EventSink listener)
          Monitor the average latency of events between two endpoints.
 void setEnabled(boolean enabled)
          Enables the Monitor service.
 void terminateAllMonitoring(Endpoint endpoint)
          Terminates all monitoring activity for the specified Endpoint.
 
Methods inherited from interface com.bea.wlevs.ede.api.EventSink
onEvent
 

Field Detail

TIME_UNIT

public static final java.util.concurrent.TimeUnit TIME_UNIT

SERVICE_ID

public static final java.lang.String SERVICE_ID

SERVICE_FILTER

public static final java.lang.String SERVICE_FILTER

STREAM_ID

public static final java.lang.String STREAM_ID

STREAM_FILTER

public static final java.lang.String STREAM_FILTER

CONTROL_STREAM_ID

public static final java.lang.String CONTROL_STREAM_ID

CONTROL_STREAM_FILTER

public static final java.lang.String CONTROL_STREAM_FILTER
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Enables the Monitor service.

Parameters:
enabled -  

isEnabled

public boolean isEnabled()
Returns if the Monitor service is enabled. Note that enabling the Monitor service does not enable any particular stages for monitoring. One still has to explicitly enable the stages for monitoring.

Returns:
boolean - true if the Monitor service is enabled

createEndpoint

public Endpoint createEndpoint(java.lang.String applicationId,
                               java.lang.String stageId,
                               Endpoint.Direction stagepoint)
Returns endpoint that represents a 'place' in the Event Server that can be monitored.

Returns:
Endpoint - monitorable stage end-point

monitorAvgThroughput

public Statement monitorAvgThroughput(Endpoint endpoint,
                                      long throughputInterval,
                                      long averageInterval,
                                      java.util.concurrent.TimeUnit unit)
Monitor the average throughput of events in an endpoint. Throughput is defined as the number of events that goes through the endpoint per the throughputInterval parameter, defined in the unit parameter. Time unit must be either in SECS or MILLISECS, but not less. The average throughput is calculated by averaging the throughput across the averageInterval parameter A MetricEvent containing the average throughput is outputed at the end of every averageInterval.

Parameters:
endpoint - - Endpoint end-point to be monitored
throughputInterval - - long throughput interval defined in TimeUnit unit
averageInterval - - long average interval defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
Returns:
Statement - used to register for MetricEvents
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS, if throughput interval is greater than average interval

monitorAvgThroughput

public java.lang.String monitorAvgThroughput(Endpoint endpoint,
                                             long throughputInterval,
                                             long averageInterval,
                                             java.util.concurrent.TimeUnit unit,
                                             EventSink listener)
Monitor the average throughput of events in an endpoint. Throughput is defined as the number of events that goes through the endpoint per the throughputInterval parameter, defined in the unit parameter. Time unit must be either in SECS or MILLISECS, but not less. The average throughput is calculated by averaging the throughput across the averageInterval parameter. A MetricEvent containing the average throughput is outputed at the end of every averageInterval.

Parameters:
endpoint - - Endpoint end-point to be monitored
throughputInterval - - long throughput interval defined in TimeUnit unit
averageInterval - - long average interval defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
listener - - EventSink listener of MetricEvents that contain the average throughput metric
Returns:
String - id of underlying Statement created to monitor throughput.
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS, if throughput interval is greater than average interval

monitorAvgLatency

public Statement monitorAvgLatency(Endpoint start,
                                   Endpoint end,
                                   long averageInterval,
                                   java.util.concurrent.TimeUnit unit)
Monitor the average latency of events between two endpoints. Latency is defined as the time it takes a event to flow between two endpoints. The average latency is calculated by averaging the latency across the averageInterval parameter. A MetricEvent containing the average latency is outputed at the end of every averageInterval in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored
averageInterval - - long average interval defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
Returns:
Statement - used to register for MetricEvents
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS,

monitorAvgLatency

public java.lang.String monitorAvgLatency(Endpoint start,
                                          Endpoint end,
                                          long averageInterval,
                                          java.util.concurrent.TimeUnit unit,
                                          EventSink listener)
Monitor the average latency of events between two endpoints. Latency is defined as the time it takes a event to flow between two endpoints. The average latency is calculated by averaging the latency across the averageInterval parameter. A MetricEvent containing the average latency is outputed at the end of every averageInterval in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored
averageInterval - - long average interval defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
listener - - EventSink listener of MetricEvents that contain the average latency metric
Returns:
String - id of underlying Statement created to monitor throughput.
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS

monitorAvgLatencyThreshold

public Statement monitorAvgLatencyThreshold(Endpoint start,
                                            Endpoint end,
                                            long averageInterval,
                                            long threshold,
                                            java.util.concurrent.TimeUnit unit)
Monitor if the average latency of events between two endpoints cross a threshold. Latency is defined as the time it takes a event to flow between two endpoints. The average latency is calculated by averaging the latency across the averageInterval parameter. A MetricEvent containing the average latency is outputed at the end of every averageInterval if the average is above the threshold parameter in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored
averageInterval - - long average interval defined in TimeUnit unit
threshold - - long latency threshold used to emit MetricEvents when crossed
unit - - TimeUnit time unit for throughput and average interval
Returns:
Statement - used to register for MetricEvents
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS,

monitorAvgLatencyThreshold

public java.lang.String monitorAvgLatencyThreshold(Endpoint start,
                                                   Endpoint end,
                                                   long averageInterval,
                                                   long threshold,
                                                   java.util.concurrent.TimeUnit unit,
                                                   EventSink listener)
Monitor if the average latency of events between two endpoints cross a threshold. Latency is defined as the time it takes a event to flow between two endpoints. The average latency is calculated by averaging the latency across the averageInterval parameter. A MetricEvent containing the average latency is outputed at the end of every averageInterval if the average is above the threshold parameter in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored
averageInterval - - long average interval defined in TimeUnit unit
threshold - - long latency threshold used to emit MetricEvents when crossed
listener - - EventSink listener of MetricEvents that contain the average throughput metric
unit - - TimeUnit time unit for throughput and average interval
Returns:
String - id of underlying Statement created to monitor throughput.
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS,

monitorMaxLatency

public Statement monitorMaxLatency(Endpoint start,
                                   Endpoint end,
                                   long maxInterval,
                                   java.util.concurrent.TimeUnit unit)
Monitor the maximum latency of events between two endpoints. Latency is defined as the time it takes a event to flow between two endpoints. The maximum latency is the highest latency to occur during the maxInterval parameter. A MetricEvent containing the max latency is outputed at the end of every maxInterval in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
Returns:
Statement - used to register for MetricEvents
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS

monitorMaxLatency

public java.lang.String monitorMaxLatency(Endpoint start,
                                          Endpoint end,
                                          long averageInterval,
                                          java.util.concurrent.TimeUnit unit,
                                          EventSink listener)
Monitor the average latency of events between two endpoints. Latency is defined as the time it takes a event to flow between two endpoints. The average latency is calculated by averaging the latency across the averageInterval parameter. A MetricEvent containing the max latency is outputed at the end of every maxInterval in MICROSECS.

Parameters:
start - - Start end-point to be monitored
end - - End end-point to be monitored
averageInterval - - long average interval defined in TimeUnit unit
unit - - TimeUnit time unit for throughput and average interval
listener - - EventSink listener of MetricEvents that contain the average latency metric
Returns:
String - id of underlying Statement created to monitor throughput.
Throws:
java.lang.IllegalArgumentException - if unit is not in SECS or MILLISECS, if intervals are less than 100 MILLISECS

terminateAllMonitoring

public void terminateAllMonitoring(Endpoint endpoint)
Terminates all monitoring activity for the specified Endpoint.

Parameters:
endpoint - The Endpoint for which monitoring activities must be stopped.


Copyright © 2007 BEA Systems All Rights Reserved.