Concurrent Channel Traffic Monitor
A concurrent implementation of a channel's traffic monitor.
Constructors
Functions
Adds a channel disconnection reason from the provided inetAddress.
Decrements connections from the provided inetAddress. This function is called when a channel handler is unregistered in Netty. Whenever a handler switches from one to another, the old one will be unregistered first, before the new one is registered. An example of this is moving from login to JS5. The exact flow is:
The duration for how long we've currently been measuring the traffic in this channel. This value is essentially just LocalDateTime.now minus startDateTime. The JvmSynthetic annotation is implied, since Duration is a value class, it would not be visible from Java anyway.
The duration for how long we've currently been measuring the traffic in this channel, in milliseconds. This value is essentially just LocalDateTime.now minus startDateTime.
Freezes tracking of any transient metrics in this channel's traffic monitor. While frozen, metrics such as incoming packets, outgoing packets and disconnections will not be updated. Active connections, however, are not impacted by the freezes, and will continue to monitor any connected channels.
Increments connections from the provided inetAddress. This function is called when a channel handler is registered in Netty.
Increments the incoming packets received from the provided inetAddress.
Increments the outgoing packet opcode counter alone, without the payload increase. We require a special function for this since our JS5Service implementation fragments the payloads into blocks of X bytes. Due to the nature of it, we may only have a single packet header, but a hundred slices of that packet's payload.
Increments the outgoing packet payload sent to the provided inetAddress.
Increments the outgoing packets sent to the provided inetAddress.
Resets all the transient channel traffic values, and returns a snapshot of what the state was just before the resetting.
Captures a snapshot of the traffic in this channel since the last reset (or when it began measuring, if it has never been reset). This function will not synchronize or reset any of the metrics.
The local datetime when the traffic began measuring. This value will be reset whenever the resetTransient function is called.