Class JGroupsMetricsManagerImpl
java.lang.Object
org.infinispan.remoting.transport.jgroups.JGroupsMetricsManagerImpl
- All Implemented Interfaces:
JGroupsMetricsManager
Concrete implementation of
JGroupsMetricsManager.
It listens on view change to remove metrics for members that left the cluster.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonChannelConnected(org.jgroups.JChannel channel, boolean isMainChannel) Registers metrics for aJChannel.voidonChannelDisconnected(org.jgroups.JChannel channel) Unregisters metrics for aJChannel.voidonViewChanged(ViewChangedEvent event) voidrecordMessageSent(Address destination, int bytesSent, boolean async) Records a message sent to adestination.voidstart()voidstop()trackRequest(Address destination) Track the latency for a synchronous request.
-
Constructor Details
-
JGroupsMetricsManagerImpl
public JGroupsMetricsManagerImpl(boolean histogramEnabled)
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
onViewChanged
-
trackRequest
Description copied from interface:JGroupsMetricsManagerTrack the latency for a synchronous request.- Specified by:
trackRequestin interfaceJGroupsMetricsManager- Parameters:
destination- The destination address. Cannot be null.- Returns:
- A
RequestTrackerimplementation with the send time already set.
-
recordMessageSent
Description copied from interface:JGroupsMetricsManagerRecords a message sent to adestination.Updates the bytes sent and, if it is an async message, the async counter.
- Specified by:
recordMessageSentin interfaceJGroupsMetricsManager- Parameters:
destination- The destination address. Cannot be null.bytesSent- The number of bytes sent in the message.async- Set totrueif the message is asynchronous.
-
onChannelConnected
public void onChannelConnected(org.jgroups.JChannel channel, boolean isMainChannel) Description copied from interface:JGroupsMetricsManagerRegisters metrics for aJChannel.- Specified by:
onChannelConnectedin interfaceJGroupsMetricsManager- Parameters:
channel- TheJChannelinstance.isMainChannel- Set totrueif this is the main channel (the cluster channel, not cross-site).
-
onChannelDisconnected
public void onChannelDisconnected(org.jgroups.JChannel channel) Description copied from interface:JGroupsMetricsManagerUnregisters metrics for aJChannel.- Specified by:
onChannelDisconnectedin interfaceJGroupsMetricsManager- Parameters:
channel- TheJChannelinstance.
-