org.apache.ignite.spi.communication.tcp

## Class TcpCommunicationMetricsListener

- java.lang.Object
- - org.apache.ignite.spi.communication.tcp.TcpCommunicationMetricsListener

All Implemented Interfaces:
  EventListener, GridNioMetricsListener

    public class TcpCommunicationMetricsListener
    extends Object
    implements GridNioMetricsListener

Statistics for `TcpCommunicationSpi`.

### Constructor Summary

Constructors
Constructor and Description
`TcpCommunicationMetricsListener()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `onBytesReceived(int bytesCnt)`
`void` `onBytesSent(int bytesCnt)`
`void` `onMessageReceived(Message msg, UUID nodeId)` Collects statistics for message received by SPI.
`void` `onMessageSent(Message msg, UUID nodeId)` Collects statistics for message sent by SPI.
`long` `receivedBytesCount()` Gets received bytes count.
`Map<UUID,Long>` `receivedMessagesByNode()` Gets received messages counts (grouped by node).
`Map<String,Long>` `receivedMessagesByType()` Gets received messages counts (grouped by type).
`int` `receivedMessagesCount()` Gets received messages count.
`void` `resetMetrics()` Resets metrics for this instance.
`long` `sentBytesCount()` Gets sent bytes count.
`Map<UUID,Long>` `sentMessagesByNode()` Gets sent messages counts (grouped by node).
`Map<String,Long>` `sentMessagesByType()` Gets sent messages counts (grouped by type).
`int` `sentMessagesCount()` Gets sent messages count.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TcpCommunicationMetricsListener

    public TcpCommunicationMetricsListener()

### Method Detail

#### onBytesSent

    public void onBytesSent(int bytesCnt)

Specified by:
  `onBytesSent` in interface `GridNioMetricsListener`
Parameters:
  `bytesCnt` - Number of sent bytes.

#### onBytesReceived

    public void onBytesReceived(int bytesCnt)

Specified by:
  `onBytesReceived` in interface `GridNioMetricsListener`
Parameters:
  `bytesCnt` - Number of received bytes.

#### onMessageSent

    public void onMessageSent(Message msg,
                              UUID nodeId)

Collects statistics for message sent by SPI.

Parameters:
  `msg` - Sent message.
  `nodeId` - Receiver node id.

#### onMessageReceived

    public void onMessageReceived(Message msg,
                                  UUID nodeId)

Collects statistics for message received by SPI.

Parameters:
  `msg` - Received message.
  `nodeId` - Sender node id.

#### sentMessagesCount

    public int sentMessagesCount()

Gets sent messages count.

Returns:
  Sent messages count.

#### sentBytesCount

    public long sentBytesCount()

Gets sent bytes count.

Returns:
  Sent bytes count.

#### receivedMessagesCount

    public int receivedMessagesCount()

Gets received messages count.

Returns:
  Received messages count.

#### receivedBytesCount

    public long receivedBytesCount()

Gets received bytes count.

Returns:
  Received bytes count.

#### receivedMessagesByType

    public Map<String,Long> receivedMessagesByType()

Gets received messages counts (grouped by type).

Returns:
  Map containing message types and respective counts.

#### receivedMessagesByNode

    public Map<UUID,Long> receivedMessagesByNode()

Gets received messages counts (grouped by node).

Returns:
  Map containing sender nodes and respective counts.

#### sentMessagesByType

    public Map<String,Long> sentMessagesByType()

Gets sent messages counts (grouped by type).

Returns:
  Map containing message types and respective counts.

#### sentMessagesByNode

    public Map<UUID,Long> sentMessagesByNode()

Gets sent messages counts (grouped by node).

Returns:
  Map containing receiver nodes and respective counts.

#### resetMetrics

    public void resetMetrics()

Resets metrics for this instance.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019