Class BinaryLogClientStatistics
java.lang.Object
com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics
- All Implemented Interfaces:
BinaryLogClient.EventListener,BinaryLogClient.LifecycleListener,BinaryLogClientStatisticsMXBean
public class BinaryLogClientStatistics
extends Object
implements BinaryLogClientStatisticsMXBean, BinaryLogClient.EventListener, BinaryLogClient.LifecycleListener
- Author:
- Stanley Shyiko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longlonglonglonglonglonglongvoidonCommunicationFailure(BinaryLogClient client, Exception ex) It's guarantied to be called beforeBinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.voidonConnect(BinaryLogClient client) Called once client has successfully logged in but before started to receive binlog events.voidonDisconnect(BinaryLogClient client) Called upon disconnect (regardless of the reason).voidvoidonEventDeserializationFailure(BinaryLogClient client, Exception ex) Called in case of failed event deserialization.voidreset()
-
Constructor Details
-
BinaryLogClientStatistics
public BinaryLogClientStatistics() -
BinaryLogClientStatistics
-
-
Method Details
-
getLastEvent
- Specified by:
getLastEventin interfaceBinaryLogClientStatisticsMXBean
-
getSecondsSinceLastEvent
public long getSecondsSinceLastEvent()- Specified by:
getSecondsSinceLastEventin interfaceBinaryLogClientStatisticsMXBean
-
getSecondsBehindMaster
public long getSecondsBehindMaster()- Specified by:
getSecondsBehindMasterin interfaceBinaryLogClientStatisticsMXBean
-
getTotalNumberOfEventsSeen
public long getTotalNumberOfEventsSeen()- Specified by:
getTotalNumberOfEventsSeenin interfaceBinaryLogClientStatisticsMXBean
-
getTotalBytesReceived
public long getTotalBytesReceived()- Specified by:
getTotalBytesReceivedin interfaceBinaryLogClientStatisticsMXBean
-
getNumberOfSkippedEvents
public long getNumberOfSkippedEvents()- Specified by:
getNumberOfSkippedEventsin interfaceBinaryLogClientStatisticsMXBean
-
getNumberOfDisconnects
public long getNumberOfDisconnects()- Specified by:
getNumberOfDisconnectsin interfaceBinaryLogClientStatisticsMXBean
-
reset
public void reset()- Specified by:
resetin interfaceBinaryLogClientStatisticsMXBean
-
onEvent
- Specified by:
onEventin interfaceBinaryLogClient.EventListener
-
onEventDeserializationFailure
Description copied from interface:BinaryLogClient.LifecycleListenerCalled in case of failed event deserialization. Note this type of error does NOT cause client to disconnect. If you wish to stop receiving events you'll need to fire client.disconnect() manually.- Specified by:
onEventDeserializationFailurein interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that failed event deserializationex- The exception that triggered the failutre
-
onDisconnect
Description copied from interface:BinaryLogClient.LifecycleListenerCalled upon disconnect (regardless of the reason).- Specified by:
onDisconnectin interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that disconnected
-
onConnect
Description copied from interface:BinaryLogClient.LifecycleListenerCalled once client has successfully logged in but before started to receive binlog events.- Specified by:
onConnectin interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that logged in
-
onCommunicationFailure
Description copied from interface:BinaryLogClient.LifecycleListenerIt's guarantied to be called beforeBinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.- Specified by:
onCommunicationFailurein interfaceBinaryLogClient.LifecycleListener- Parameters:
client- the client that triggered the communication failureex- The exception that triggered the communication failutre
-
getCurrentTimeMillis
protected long getCurrentTimeMillis()
-