Spring Integration

org.springframework.integration.monitor
Class SimpleMessageChannelMonitor

java.lang.Object
  extended by org.springframework.integration.monitor.SimpleMessageChannelMonitor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, MessageChannelMonitor
Direct Known Subclasses:
PollableChannelMonitor

@ManagedResource
public class SimpleMessageChannelMonitor
extends Object
implements org.aopalliance.intercept.MethodInterceptor, MessageChannelMonitor

Registers all message channels, and accumulates statistics about their performance. The statistics are then published locally for other components to consume and publish remotely.

Author:
Dave Syer, Helena Edelson

Field Summary
static int DEFAULT_MOVING_AVERAGE_WINDOW
           
protected  org.apache.commons.logging.Log logger
           
static long ONE_MINUTE_SECONDS
           
static long ONE_SECOND_SECONDS
           
 
Constructor Summary
SimpleMessageChannelMonitor(String name)
           
 
Method Summary
 void destroy()
           
protected  Object doInvoke(org.aopalliance.intercept.MethodInvocation invocation, String method, MessageChannel channel)
           
 double getErrorRate()
           
 double getErrorRatio()
           
 double getMaxSendDuration()
           
 double getMeanSendDuration()
           
 double getMinSendDuration()
           
 String getName()
           
 int getSendCount()
           
 int getSendErrorCount()
           
 double getSendRate()
           
 double getStandardDeviationSendDuration()
           
 double getTimeSinceLastSend()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

ONE_SECOND_SECONDS

public static final long ONE_SECOND_SECONDS
See Also:
Constant Field Values

ONE_MINUTE_SECONDS

public static final long ONE_MINUTE_SECONDS
See Also:
Constant Field Values

DEFAULT_MOVING_AVERAGE_WINDOW

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

SimpleMessageChannelMonitor

public SimpleMessageChannelMonitor(String name)
Method Detail

destroy

public void destroy()

getName

public String getName()

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable

doInvoke

protected Object doInvoke(org.aopalliance.intercept.MethodInvocation invocation,
                          String method,
                          MessageChannel channel)
                   throws Throwable
Throws:
Throwable

getSendCount

@ManagedMetric(metricType=COUNTER,
               displayName="MessageChannel Sends")
public int getSendCount()
Specified by:
getSendCount in interface MessageChannelMonitor

getSendErrorCount

@ManagedMetric(metricType=COUNTER,
               displayName="MessageChannel Send Errors")
public int getSendErrorCount()
Specified by:
getSendErrorCount in interface MessageChannelMonitor

getTimeSinceLastSend

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Time Since Last Send in Seconds")
public double getTimeSinceLastSend()
Specified by:
getTimeSinceLastSend in interface MessageChannelMonitor

getSendRate

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Send Rate per Second")
public double getSendRate()
Specified by:
getSendRate in interface MessageChannelMonitor

getErrorRate

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Error Rate per Second")
public double getErrorRate()
Specified by:
getErrorRate in interface MessageChannelMonitor

getErrorRatio

@ManagedMetric(metricType=GAUGE,
               displayName="Mean Channel Error Ratio per Minute")
public double getErrorRatio()
Specified by:
getErrorRatio in interface MessageChannelMonitor

getMeanSendDuration

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Send Mean Duration")
public double getMeanSendDuration()
Specified by:
getMeanSendDuration in interface MessageChannelMonitor

getMinSendDuration

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Send Min Duration")
public double getMinSendDuration()
Specified by:
getMinSendDuration in interface MessageChannelMonitor

getMaxSendDuration

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Send Max Duration")
public double getMaxSendDuration()
Specified by:
getMaxSendDuration in interface MessageChannelMonitor

getStandardDeviationSendDuration

@ManagedMetric(metricType=GAUGE,
               displayName="Channel Send Standard Deviation Duration")
public double getStandardDeviationSendDuration()
Specified by:
getStandardDeviationSendDuration in interface MessageChannelMonitor

toString

public String toString()
Overrides:
toString in class Object

Spring Integration

Copyright © 2010. All Rights Reserved.