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 void
destroy()
int
getActiveChildren()
Return the number of active children for this endpointdouble
getAvgSizeReceived()
double
getAvgSizeSent()
long
getBytesReceived()
Number of bytes received, receiving replieslong
getBytesSent()
Number of bytes sentint
getConsecutiveEndpointSuspensions()
int
getConsecutiveEndpointTimeouts()
long
getFaultsReceiving()
Number of faults, receiving replieslong
getFaultsSending()
Number of faults sendingint
getLast15MinuteEndpointSuspensions()
int
getLast15MinuteEndpointTimeouts()
int
getLast5MinuteEndpointSuspensions()
int
getLast5MinuteEndpointTimeouts()
int
getLastMinuteEndpointSuspensions()
int
getLastMinuteEndpointTimeouts()
long
getLastResetTime()
Time when statistics was last reset for this leaf endpointlong
getMaxSizeReceived()
long
getMaxSizeSent()
long
getMessagesReceived()
Number of messages (ie replies) receivedlong
getMessagesSent()
Number of messages sentlong
getMetricsWindow()
Time since statistics was last reset for this leaf endpointlong
getMinSizeReceived()
long
getMinSizeSent()
int
getReadyChildren()
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 countDate
getSuspendedAt()
Date
getTimedoutAt()
long
getTimeoutsReceiving()
Number of timeouts, receiving replieslong
getTimeoutsSending()
Number of timeouts, sendingint
getTotalChildren()
Return number of children for this endpointint
getTotalEndpointSuspensions()
int
getTotalEndpointTimeouts()
void
incrementBytesReceived(long size)
void
incrementBytesSent(long size)
void
incrementFaultsReceiving(int errorCode)
void
incrementFaultsSending(int errorCode)
void
incrementMessagesReceived()
void
incrementMessagesSent()
void
incrementSuspensions()
void
incrementTimeouts()
void
incrementTimeoutsReceiving()
void
incrementTimeoutsSending()
boolean
isActive()
Is a leaf level endpoint active? For a group endpoint this means at least one is activeboolean
isEndpointInState(int state)
Is the endpoint considered to be in the given state?boolean
isSuspended()
Is this leaf level endpoint in suspend state?boolean
isSwitchedOff()
Is this leaf level endpoint switched off?boolean
isTimedout()
Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?void
notifyReceivedMessageSize(long size)
void
notifySentMessageSize(long size)
void
reportReceivingFault(int errorCode)
Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault countvoid
reportResponseCode(int respCode)
Collect response code statisticsvoid
reportSendingFault(int errorCode)
Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g.void
resetConsecutiveSuspensions()
void
resetConsecutiveTimeouts()
void
resetStatistics()
void
setSuspendedAt(Date suspendedAt)
void
setTimedoutAt(Date timedoutAt)
void
switchOff()
Switch off a leaf endpoint, or all endpoints of a group - for maintenancevoid
switchOn()
Switch on a leaf endpoint, or all endpoints on a group - from maintenance
-
-
-
Method Detail
-
destroy
public void destroy()
-
switchOn
public void switchOn() throws Exception
Switch on a leaf endpoint, or all endpoints on a group - from maintenance- Specified by:
switchOn
in interfaceEndpointViewMBean
- Throws:
Exception
-
switchOff
public void switchOff() throws Exception
Switch off a leaf endpoint, or all endpoints of a group - for maintenance- Specified by:
switchOff
in interfaceEndpointViewMBean
- Throws:
Exception
-
isActive
public boolean isActive() throws Exception
Is a leaf level endpoint active? For a group endpoint this means at least one is active- Specified by:
isActive
in 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 Exception
Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?- Specified by:
isTimedout
in 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 Exception
Is this leaf level endpoint in suspend state?- Specified by:
isSuspended
in interfaceEndpointViewMBean
- Returns:
- true if a leaf level endpoint is suspended, false for group endpoints and non-suspend
- Throws:
Exception
-
isSwitchedOff
public boolean isSwitchedOff() throws Exception
Is this leaf level endpoint switched off?- Specified by:
isSwitchedOff
in interfaceEndpointViewMBean
- Returns:
- true if a leaf level endpoint is off, false for group endpoints and non-off
- Throws:
Exception
-
getTotalChildren
public int getTotalChildren() throws Exception
Return number of children for this endpoint- Specified by:
getTotalChildren
in interfaceEndpointViewMBean
- Returns:
- the number of children for this endpoint
- Throws:
Exception
-
getActiveChildren
public int getActiveChildren() throws Exception
Return the number of active children for this endpoint- Specified by:
getActiveChildren
in interfaceEndpointViewMBean
- Returns:
- the number of active children for this endpoint
- Throws:
Exception
-
getReadyChildren
public int getReadyChildren() throws Exception
Return the number of ready children for this endpoint- Specified by:
getReadyChildren
in 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:
getLastResetTime
in 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:
getMetricsWindow
in 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:
getReceivingFaultTable
in 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:
getSendingFaultTable
in interfaceEndpointViewMBean
- Returns:
- a Map of send faults
-
getResponseCodeTable
public Map<Integer,Long> getResponseCodeTable()
A Map of response codes and counts- Specified by:
getResponseCodeTable
in interfaceEndpointViewMBean
- Returns:
- a Map of response codes and counts
-
getSuspendedAt
public Date getSuspendedAt()
- Specified by:
getSuspendedAt
in interfaceEndpointViewMBean
-
setSuspendedAt
public void setSuspendedAt(Date suspendedAt)
-
getTimedoutAt
public Date getTimedoutAt()
- Specified by:
getTimedoutAt
in interfaceEndpointViewMBean
-
setTimedoutAt
public void setTimedoutAt(Date timedoutAt)
-
getConsecutiveEndpointSuspensions
public int getConsecutiveEndpointSuspensions()
- Specified by:
getConsecutiveEndpointSuspensions
in interfaceEndpointViewMBean
-
incrementSuspensions
public void incrementSuspensions()
-
resetConsecutiveSuspensions
public void resetConsecutiveSuspensions()
-
getConsecutiveEndpointTimeouts
public int getConsecutiveEndpointTimeouts()
- Specified by:
getConsecutiveEndpointTimeouts
in interfaceEndpointViewMBean
-
incrementTimeouts
public void incrementTimeouts()
-
resetConsecutiveTimeouts
public void resetConsecutiveTimeouts()
-
getTotalEndpointSuspensions
public int getTotalEndpointSuspensions()
- Specified by:
getTotalEndpointSuspensions
in interfaceEndpointViewMBean
-
getTotalEndpointTimeouts
public int getTotalEndpointTimeouts()
- Specified by:
getTotalEndpointTimeouts
in interfaceEndpointViewMBean
-
getLastMinuteEndpointSuspensions
public int getLastMinuteEndpointSuspensions()
- Specified by:
getLastMinuteEndpointSuspensions
in interfaceEndpointViewMBean
-
getLast5MinuteEndpointSuspensions
public int getLast5MinuteEndpointSuspensions()
- Specified by:
getLast5MinuteEndpointSuspensions
in interfaceEndpointViewMBean
-
getLast15MinuteEndpointSuspensions
public int getLast15MinuteEndpointSuspensions()
- Specified by:
getLast15MinuteEndpointSuspensions
in interfaceEndpointViewMBean
-
getLastMinuteEndpointTimeouts
public int getLastMinuteEndpointTimeouts()
- Specified by:
getLastMinuteEndpointTimeouts
in interfaceEndpointViewMBean
-
getLast5MinuteEndpointTimeouts
public int getLast5MinuteEndpointTimeouts()
- Specified by:
getLast5MinuteEndpointTimeouts
in interfaceEndpointViewMBean
-
getLast15MinuteEndpointTimeouts
public int getLast15MinuteEndpointTimeouts()
- Specified by:
getLast15MinuteEndpointTimeouts
in interfaceEndpointViewMBean
-
getMessagesReceived
public long getMessagesReceived()
Number of messages (ie replies) received- Specified by:
getMessagesReceived
in interfaceEndpointViewMBean
- Returns:
- # of messages (replies) received
-
getFaultsReceiving
public long getFaultsReceiving()
Number of faults, receiving replies- Specified by:
getFaultsReceiving
in interfaceEndpointViewMBean
- Returns:
- # of faults, receiving replies
-
getTimeoutsReceiving
public long getTimeoutsReceiving()
Number of timeouts, receiving replies- Specified by:
getTimeoutsReceiving
in interfaceEndpointViewMBean
- Returns:
- # of timeouts, receiving replies
-
getBytesReceived
public long getBytesReceived()
Number of bytes received, receiving replies- Specified by:
getBytesReceived
in interfaceEndpointViewMBean
- Returns:
- # of bytes received, receiving replies
-
getMessagesSent
public long getMessagesSent()
Number of messages sent- Specified by:
getMessagesSent
in interfaceEndpointViewMBean
- Returns:
- # of messages sent
-
getFaultsSending
public long getFaultsSending()
Number of faults sending- Specified by:
getFaultsSending
in interfaceEndpointViewMBean
- Returns:
- # of faults sending
-
getTimeoutsSending
public long getTimeoutsSending()
Number of timeouts, sending- Specified by:
getTimeoutsSending
in interfaceEndpointViewMBean
- Returns:
- # of timeouts, sending
-
getBytesSent
public long getBytesSent()
Number of bytes sent- Specified by:
getBytesSent
in interfaceEndpointViewMBean
- Returns:
- # of bytes sent
-
getMinSizeReceived
public long getMinSizeReceived()
- Specified by:
getMinSizeReceived
in interfaceEndpointViewMBean
-
getMaxSizeReceived
public long getMaxSizeReceived()
- Specified by:
getMaxSizeReceived
in interfaceEndpointViewMBean
-
getMinSizeSent
public long getMinSizeSent()
- Specified by:
getMinSizeSent
in interfaceEndpointViewMBean
-
getMaxSizeSent
public long getMaxSizeSent()
- Specified by:
getMaxSizeSent
in interfaceEndpointViewMBean
-
getAvgSizeReceived
public double getAvgSizeReceived()
- Specified by:
getAvgSizeReceived
in interfaceEndpointViewMBean
-
getAvgSizeSent
public double getAvgSizeSent()
- Specified by:
getAvgSizeSent
in interfaceEndpointViewMBean
-
resetStatistics
public void resetStatistics()
- Specified by:
resetStatistics
in interfaceEndpointViewMBean
-
incrementMessagesReceived
public void incrementMessagesReceived()
- Specified by:
incrementMessagesReceived
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementFaultsReceiving
public void incrementFaultsReceiving(int errorCode)
- Specified by:
incrementFaultsReceiving
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementTimeoutsReceiving
public void incrementTimeoutsReceiving()
- Specified by:
incrementTimeoutsReceiving
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementBytesReceived
public void incrementBytesReceived(long size)
- Specified by:
incrementBytesReceived
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementMessagesSent
public void incrementMessagesSent()
- Specified by:
incrementMessagesSent
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementFaultsSending
public void incrementFaultsSending(int errorCode)
- Specified by:
incrementFaultsSending
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementTimeoutsSending
public void incrementTimeoutsSending()
- Specified by:
incrementTimeoutsSending
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
incrementBytesSent
public void incrementBytesSent(long size)
- Specified by:
incrementBytesSent
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
notifyReceivedMessageSize
public void notifyReceivedMessageSize(long size)
- Specified by:
notifyReceivedMessageSize
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
-
notifySentMessageSize
public void notifySentMessageSize(long size)
- Specified by:
notifySentMessageSize
in 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:
reportSendingFault
in 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:
reportReceivingFault
in interfaceorg.apache.axis2.transport.base.MessageLevelMetricsCollector
- Parameters:
errorCode
- the code to report
-
reportResponseCode
public void reportResponseCode(int respCode)
Collect response code statistics- Specified by:
reportResponseCode
in 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
-
-