org.apache.ignite.spi.discovery.tcp.internal

## Class TcpDiscoveryStatistics

- java.lang.Object
- - org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryStatistics

    public class TcpDiscoveryStatistics
    extends Object

Statistics for `TcpDiscoverySpi`.

### Constructor Summary

Constructors
Constructor and Description
`TcpDiscoveryStatistics()`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `avgMessageProcessingTime()` Gets average message processing time.
`void` `clear()` Clears statistics.
`long` `coordinatorSinceTimestamp()` Gets time local node has been coordinator since.
`int` `failedNodesCount()` Gets failed nodes count.
`int` `joinedNodesCount()` Gets nodes joined count.
`int` `leftNodesCount()` Gets nodes left count.
`long` `maxMessageProcessingTime()` Gets max message processing time.
`void` `onBecomingCoordinator()` Initializes coordinator since date (if needed).
`void` `onMessageProcessingFinished(TcpDiscoveryAbstractMessage msg)` Collects necessary stats for message processed by SPI.
`void` `onMessageProcessingStarted(TcpDiscoveryAbstractMessage msg)` Collects necessary stats for message processed by SPI.
`void` `onMessageReceived(TcpDiscoveryAbstractMessage msg)` Collects necessary stats for message received by SPI.
`void` `onMessageSent(TcpDiscoveryAbstractMessage msg, long time)` Called by coordinator when ring message is sent.
`void` `onNodeFailed()` Increments failed nodes count.
`void` `onNodeJoined()` Increments joined nodes count.
`void` `onNodeLeft()` Increments left nodes count.
`void` `onPendingMessageRegistered()` Increments pending messages registered count.
`void` `onSslConnectionRejected()` Increments connections count that were rejected due to SSL errors.
`long` `pendingMessagesRegistered()` Gets pending messages registered count.
`Map<String,Integer>` `processedMessages()` Gets processed messages counts (grouped by type).
`Map<String,Integer>` `receivedMessages()` Gets received messages counts (grouped by type).
`void` `registerMetrics(MetricRegistry discoReg)`
`Map<String,Integer>` `sentMessages()`
`String` `toString()`
`int` `totalProcessedMessages()` Gets total processed messages count.
`int` `totalReceivedMessages()` Gets total received messages count.

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

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

### Constructor Detail

#### TcpDiscoveryStatistics

    public TcpDiscoveryStatistics()

### Method Detail

#### registerMetrics

    public void registerMetrics(MetricRegistry discoReg)

Parameters:
  `discoReg` - Discovery metric registry.

#### onNodeJoined

    public void onNodeJoined()

Increments joined nodes count.

#### onNodeLeft

    public void onNodeLeft()

Increments left nodes count.

#### onNodeFailed

    public void onNodeFailed()

Increments failed nodes count.

#### onBecomingCoordinator

    public void onBecomingCoordinator()

Initializes coordinator since date (if needed).

#### onSslConnectionRejected

    public void onSslConnectionRejected()

Increments connections count that were rejected due to SSL errors.

#### onMessageReceived

    public void onMessageReceived(TcpDiscoveryAbstractMessage msg)

Collects necessary stats for message received by SPI.

Parameters:
  `msg` - Received message.

#### onMessageProcessingStarted

    public void onMessageProcessingStarted(TcpDiscoveryAbstractMessage msg)

Collects necessary stats for message processed by SPI.

Parameters:
  `msg` - Processed message.

#### onMessageProcessingFinished

    public void onMessageProcessingFinished(TcpDiscoveryAbstractMessage msg)

Collects necessary stats for message processed by SPI.

Parameters:
  `msg` - Processed message.

#### onMessageSent

    public void onMessageSent(TcpDiscoveryAbstractMessage msg,
                              long time)

Called by coordinator when ring message is sent.

Parameters:
  `msg` - Sent message.
  `time` - Time taken to serialize message.

#### onPendingMessageRegistered

    public void onPendingMessageRegistered()

Increments pending messages registered count.

#### processedMessages

    public Map<String,Integer> processedMessages()

Gets processed messages counts (grouped by type).

Returns:
  Map containing message types and respective counts.

#### receivedMessages

    public Map<String,Integer> receivedMessages()

Gets received messages counts (grouped by type).

Returns:
  Map containing message types and respective counts.

#### sentMessages

    public Map<String,Integer> sentMessages()

Returns:
  Sent messages counts (grouped by type).

#### totalReceivedMessages

    public int totalReceivedMessages()

Gets total received messages count.

Returns:
  Total received messages count.

#### totalProcessedMessages

    public int totalProcessedMessages()

Gets total processed messages count.

Returns:
  Total processed messages count.

#### maxMessageProcessingTime

    public long maxMessageProcessingTime()

Gets max message processing time.

Returns:
  Max message processing time.

#### avgMessageProcessingTime

    public long avgMessageProcessingTime()

Gets average message processing time.

Returns:
  Average message processing time.

#### pendingMessagesRegistered

    public long pendingMessagesRegistered()

Gets pending messages registered count.

Returns:
  Pending messages registered count.

#### joinedNodesCount

    public int joinedNodesCount()

Gets nodes joined count.

Returns:
  Nodes joined count.

#### leftNodesCount

    public int leftNodesCount()

Gets nodes left count.

Returns:
  Nodes left count.

#### failedNodesCount

    public int failedNodesCount()

Gets failed nodes count.

Returns:
  Failed nodes count.

#### coordinatorSinceTimestamp

    public long coordinatorSinceTimestamp()

Gets time local node has been coordinator since.

Returns:
  Coordinator since timestamp.

#### clear

    public void clear()

Clears statistics.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021