Package org.apache.synapse.endpoints
Class EndpointView
- java.lang.Object
-
- org.apache.synapse.endpoints.EndpointView
-
- All Implemented Interfaces:
org.apache.axis2.transport.base.MessageLevelMetricsCollector,EndpointViewMBean
public class EndpointView extends Object implements EndpointViewMBean, org.apache.axis2.transport.base.MessageLevelMetricsCollector
This class is the metrics collector and JMX control point for Endpoints
-
-
Constructor Summary
Constructors Constructor Description EndpointView(String endpointName, Endpoint endpoint)Create a new MBean to manage the given endpoint
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()intgetActiveChildren()Return the number of active children for this endpointdoublegetAvgSizeReceived()doublegetAvgSizeSent()longgetBytesReceived()Number of bytes received, receiving replieslonggetBytesSent()Number of bytes sentintgetConsecutiveEndpointSuspensions()intgetConsecutiveEndpointTimeouts()longgetFaultsReceiving()Number of faults, receiving replieslonggetFaultsSending()Number of faults sendingintgetLast15MinuteEndpointSuspensions()intgetLast15MinuteEndpointTimeouts()intgetLast5MinuteEndpointSuspensions()intgetLast5MinuteEndpointTimeouts()intgetLastMinuteEndpointSuspensions()intgetLastMinuteEndpointTimeouts()longgetLastResetTime()Time when statistics was last reset for this leaf endpointlonggetMaxSizeReceived()longgetMaxSizeSent()longgetMessagesReceived()Number of messages (ie replies) receivedlonggetMessagesSent()Number of messages sentlonggetMetricsWindow()Time since statistics was last reset for this leaf endpointlonggetMinSizeReceived()longgetMinSizeSent()intgetReadyChildren()Return the number of ready children for this endpointMap<Integer,Long>getReceivingFaultTable()A Map of receive faults with the error code and countMap<Integer,Long>getResponseCodeTable()A Map of response codes and countsMap<Integer,Long>getSendingFaultTable()A Map of send faults with the error code and countDategetSuspendedAt()DategetTimedoutAt()longgetTimeoutsReceiving()Number of timeouts, receiving replieslonggetTimeoutsSending()Number of timeouts, sendingintgetTotalChildren()Return number of children for this endpointintgetTotalEndpointSuspensions()intgetTotalEndpointTimeouts()voidincrementBytesReceived(long size)voidincrementBytesSent(long size)voidincrementFaultsReceiving(int errorCode)voidincrementFaultsSending(int errorCode)voidincrementMessagesReceived()voidincrementMessagesSent()voidincrementSuspensions()voidincrementTimeouts()voidincrementTimeoutsReceiving()voidincrementTimeoutsSending()booleanisActive()Is a leaf level endpoint active? For a group endpoint this means at least one is activebooleanisEndpointInState(int state)Is the endpoint considered to be in the given state?booleanisSuspended()Is this leaf level endpoint in suspend state?booleanisSwitchedOff()Is this leaf level endpoint switched off?booleanisTimedout()Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?voidnotifyReceivedMessageSize(long size)voidnotifySentMessageSize(long size)voidreportReceivingFault(int errorCode)Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault countvoidreportResponseCode(int respCode)Collect response code statisticsvoidreportSendingFault(int errorCode)Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g.voidresetConsecutiveSuspensions()voidresetConsecutiveTimeouts()voidresetStatistics()voidsetSuspendedAt(Date suspendedAt)voidsetTimedoutAt(Date timedoutAt)voidswitchOff()Switch off a leaf endpoint, or all endpoints of a group - for maintenancevoidswitchOn()Switch on a leaf endpoint, or all endpoints on a group - from maintenance
-
-
-
Method Detail
-
destroy
public void destroy()
-
switchOn
public void switchOn() throws ExceptionSwitch on a leaf endpoint, or all endpoints on a group - from maintenance- Specified by:
switchOnin interfaceEndpointViewMBean- Throws:
Exception
-
switchOff
public void switchOff() throws ExceptionSwitch off a leaf endpoint, or all endpoints of a group - for maintenance- Specified by:
switchOffin interfaceEndpointViewMBean- Throws:
Exception
-
isActive
public boolean isActive() throws ExceptionIs a leaf level endpoint active? For a group endpoint this means at least one is active- Specified by:
isActivein interfaceEndpointViewMBean- Returns:
- true if at least one is active in a group endpoint; for a leaf - if it is currently active
- Throws:
Exception
-
isTimedout
public boolean isTimedout() throws ExceptionIs this leaf level endpoint in timeout state? For a group, has all endpoints timed out?- Specified by:
isTimedoutin interfaceEndpointViewMBean- Returns:
- true if a leaf level endpoint has timed out, For a group, has all endpoints timed out?
- Throws:
Exception
-
isSuspended
public boolean isSuspended() throws ExceptionIs this leaf level endpoint in suspend state?- Specified by:
isSuspendedin interfaceEndpointViewMBean- Returns:
- true if a leaf level endpoint is suspended, false for group endpoints and non-suspend
- Throws:
Exception
-
isSwitchedOff
public boolean isSwitchedOff() throws ExceptionIs this leaf level endpoint switched off?- Specified by:
isSwitchedOffin interfaceEndpointViewMBean- Returns:
- true if a leaf level endpoint is off, false for group endpoints and non-off
- Throws:
Exception
-
getTotalChildren
public int getTotalChildren() throws ExceptionReturn number of children for this endpoint- Specified by:
getTotalChildrenin interfaceEndpointViewMBean- Returns:
- the number of children for this endpoint
- Throws:
Exception
-
getActiveChildren
public int getActiveChildren() throws ExceptionReturn the number of active children for this endpoint- Specified by:
getActiveChildrenin interfaceEndpointViewMBean- Returns:
- the number of active children for this endpoint
- Throws:
Exception
-
getReadyChildren
public int getReadyChildren() throws ExceptionReturn the number of ready children for this endpoint- Specified by:
getReadyChildrenin interfaceEndpointViewMBean- Returns:
- the number of ready children for this endpoint
- Throws:
Exception
-
getLastResetTime
public long getLastResetTime()
Time when statistics was last reset for this leaf endpoint- Specified by:
getLastResetTimein interfaceEndpointViewMBean- Returns:
- the time when statistics was last reset for this leaf endpoint, or -1 for group endpoints
-
getMetricsWindow
public long getMetricsWindow()
Time since statistics was last reset for this leaf endpoint- Specified by:
getMetricsWindowin interfaceEndpointViewMBean- Returns:
- the time since statistics was last reset for this leaf endpoint, or -1 for group endpoints
-
getReceivingFaultTable
public Map<Integer,Long> getReceivingFaultTable()
A Map of receive faults with the error code and count- Specified by:
getReceivingFaultTablein interfaceEndpointViewMBean- Returns:
- a Map of receive faults
-
getSendingFaultTable
public Map<Integer,Long> getSendingFaultTable()
A Map of send faults with the error code and count- Specified by:
getSendingFaultTablein interfaceEndpointViewMBean- Returns:
- a Map of send faults
-
getResponseCodeTable
public Map<Integer,Long> getResponseCodeTable()
A Map of response codes and counts- Specified by:
getResponseCodeTablein interfaceEndpointViewMBean- Returns:
- a Map of response codes and counts
-
getSuspendedAt
public Date getSuspendedAt()
- Specified by:
getSuspendedAtin interfaceEndpointViewMBean
-
setSuspendedAt
public void setSuspendedAt(Date suspendedAt)
-
getTimedoutAt
public Date getTimedoutAt()
- Specified by:
getTimedoutAtin interfaceEndpointViewMBean
-
setTimedoutAt
public void setTimedoutAt(Date timedoutAt)
-
getConsecutiveEndpointSuspensions
public int getConsecutiveEndpointSuspensions()
- Specified by:
getConsecutiveEndpointSuspensionsin interfaceEndpointViewMBean
-
incrementSuspensions
public void incrementSuspensions()
-
resetConsecutiveSuspensions
public void resetConsecutiveSuspensions()
-
getConsecutiveEndpointTimeouts
public int getConsecutiveEndpointTimeouts()
- Specified by:
getConsecutiveEndpointTimeoutsin interfaceEndpointViewMBean
-
incrementTimeouts
public void incrementTimeouts()
-
resetConsecutiveTimeouts
public void resetConsecutiveTimeouts()
-
getTotalEndpointSuspensions
public int getTotalEndpointSuspensions()
- Specified by:
getTotalEndpointSuspensionsin interfaceEndpointViewMBean
-
getTotalEndpointTimeouts
public int getTotalEndpointTimeouts()
- Specified by:
getTotalEndpointTimeoutsin interfaceEndpointViewMBean
-
getLastMinuteEndpointSuspensions
public int getLastMinuteEndpointSuspensions()
- Specified by:
getLastMinuteEndpointSuspensionsin interfaceEndpointViewMBean
-
getLast5MinuteEndpointSuspensions
public int getLast5MinuteEndpointSuspensions()
- Specified by:
getLast5MinuteEndpointSuspensionsin interfaceEndpointViewMBean
-
getLast15MinuteEndpointSuspensions
public int getLast15MinuteEndpointSuspensions()
- Specified by:
getLast15MinuteEndpointSuspensionsin interfaceEndpointViewMBean
-
getLastMinuteEndpointTimeouts
public int getLastMinuteEndpointTimeouts()
- Specified by:
getLastMinuteEndpointTimeoutsin interfaceEndpointViewMBean
-
getLast5MinuteEndpointTimeouts
public int getLast5MinuteEndpointTimeouts()
- Specified by:
getLast5MinuteEndpointTimeoutsin interfaceEndpointViewMBean
-
getLast15MinuteEndpointTimeouts
public int getLast15MinuteEndpointTimeouts()
- Specified by:
getLast15MinuteEndpointTimeoutsin interfaceEndpointViewMBean
-
getMessagesReceived
public long getMessagesReceived()
Number of messages (ie replies) received- Specified by:
getMessagesReceivedin interfaceEndpointViewMBean- Returns:
- # of messages (replies) received
-
getFaultsReceiving
public long getFaultsReceiving()
Number of faults, receiving replies- Specified by:
getFaultsReceivingin interfaceEndpointViewMBean- Returns:
- # of faults, receiving replies
-
getTimeoutsReceiving
public long getTimeoutsReceiving()
Number of timeouts, receiving replies- Specified by:
getTimeoutsReceivingin interfaceEndpointViewMBean- Returns:
- # of timeouts, receiving replies
-
getBytesReceived
public long getBytesReceived()
Number of bytes received, receiving replies- Specified by:
getBytesReceivedin interfaceEndpointViewMBean- Returns:
- # of bytes received, receiving replies
-
getMessagesSent
public long getMessagesSent()
Number of messages sent- Specified by:
getMessagesSentin interfaceEndpointViewMBean- Returns:
- # of messages sent
-
getFaultsSending
public long getFaultsSending()
Number of faults sending- Specified by:
getFaultsSendingin interfaceEndpointViewMBean- Returns:
- # of faults sending
-
getTimeoutsSending
public long getTimeoutsSending()
Number of timeouts, sending- Specified by:
getTimeoutsSendingin interfaceEndpointViewMBean- Returns:
- # of timeouts, sending
-
getBytesSent
public long getBytesSent()
Number of bytes sent- Specified by:
getBytesSentin interfaceEndpointViewMBean- Returns:
- # of bytes sent
-
getMinSizeReceived
public long getMinSizeReceived()
- Specified by:
getMinSizeReceivedin interfaceEndpointViewMBean
-
getMaxSizeReceived
public long getMaxSizeReceived()
- Specified by:
getMaxSizeReceivedin interfaceEndpointViewMBean
-
getMinSizeSent
public long getMinSizeSent()
- Specified by:
getMinSizeSentin interfaceEndpointViewMBean
-
getMaxSizeSent
public long getMaxSizeSent()
- Specified by:
getMaxSizeSentin interfaceEndpointViewMBean
-
getAvgSizeReceived
public double getAvgSizeReceived()
- Specified by:
getAvgSizeReceivedin interfaceEndpointViewMBean
-
getAvgSizeSent
public double getAvgSizeSent()
- Specified by:
getAvgSizeSentin interfaceEndpointViewMBean
-
resetStatistics
public void resetStatistics()
- Specified by:
resetStatisticsin interfaceEndpointViewMBean
-
incrementMessagesReceived
public void incrementMessagesReceived()
- Specified by:
incrementMessagesReceivedin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementFaultsReceiving
public void incrementFaultsReceiving(int errorCode)
- Specified by:
incrementFaultsReceivingin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementTimeoutsReceiving
public void incrementTimeoutsReceiving()
- Specified by:
incrementTimeoutsReceivingin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementBytesReceived
public void incrementBytesReceived(long size)
- Specified by:
incrementBytesReceivedin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementMessagesSent
public void incrementMessagesSent()
- Specified by:
incrementMessagesSentin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementFaultsSending
public void incrementFaultsSending(int errorCode)
- Specified by:
incrementFaultsSendingin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementTimeoutsSending
public void incrementTimeoutsSending()
- Specified by:
incrementTimeoutsSendingin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementBytesSent
public void incrementBytesSent(long size)
- Specified by:
incrementBytesSentin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
notifyReceivedMessageSize
public void notifyReceivedMessageSize(long size)
- Specified by:
notifyReceivedMessageSizein interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
notifySentMessageSize
public void notifySentMessageSize(long size)
- Specified by:
notifySentMessageSizein interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
reportSendingFault
public void reportSendingFault(int errorCode)
Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g. to report a successful fail-over etc- Specified by:
reportSendingFaultin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector- Parameters:
errorCode- the code to report
-
reportReceivingFault
public void reportReceivingFault(int errorCode)
Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault count- Specified by:
reportReceivingFaultin interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector- Parameters:
errorCode- the code to report
-
reportResponseCode
public void reportResponseCode(int respCode)
Collect response code statistics- Specified by:
reportResponseCodein interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector- Parameters:
respCode- response code
-
isEndpointInState
public boolean isEndpointInState(int state)
Is the endpoint considered to be in the given state?- Parameters:
state- the state to consider- Returns:
- true if all endpoints in a group are of the given state, or if a leaf endpoint is in the given state
-
-