Class ClientStats
What a client holds and has counted, as only the client can know it, collected at one point
after MqttClient.stats() was called. The values of one snapshot agree with each other: each
unfinished QoS 1 or QoS 2 exchange counts in exactly one of its stages, and the registrations
add up to their total. The stages move when the client processes an event, such as the
completion of a write. Values that other threads change are read right after: those of the
send queue, of the operation capacity, and of deliveries and delivery lanes. They can already
show a completed write, a handler that has returned, or an MqttDelivery.ack() that has been
called before the client has processed it.
Counts described as lifetime counts cover the client's whole life and only grow. Durations
are measured with the client's TimerScheduler. Maps contain every key of their enum, in its
order, with zero for what never happened. A limit shown with a value is the one in force when
the snapshot was taken; the client may change the internal ones in later versions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe connection's state and attempt numbers.static enumThe state of a client's connection.static enumWhy a delivery left its subscription unprocessed.static enumWhy the client ended a connection as overloaded.static final classIncoming publications, their deliveries, and their acknowledgement exchanges.static final classOutgoing writes and publication exchanges.static final classThe subscription registrations and delivery lanes, in total.static final classThe values of one subscription.static final recordHow much of a limit is in use. -
Method Summary
Modifier and TypeMethodDescriptionReturns the connection's state and attempt numbers.longReturns a lifetime count ofMetricsListenerevents dropped because the listener fell behind.booleaninthashCode()Returns lifetime counts of connections that the client ended because it was overloaded, by cause.Returns the values of incoming publications, their deliveries, and their acknowledgement exchanges.refusals()Returns lifetime counts of operations that the client refused for capacity, by the limit that refused them.sending()Returns the values of outgoing writes and publication exchanges.Returns the values of the subscription registrations and delivery lanes, in total.Returns the values of each subscription that the client holds, in no particular order.toString()
-
Method Details
-
connection
Returns the connection's state and attempt numbers.- Returns:
- the connection's state and attempt numbers
-
receiving
Returns the values of incoming publications, their deliveries, and their acknowledgement exchanges.- Returns:
- the values of incoming publications, their deliveries, and their acknowledgement exchanges
-
sending
Returns the values of outgoing writes and publication exchanges.- Returns:
- the values of outgoing writes and publication exchanges
-
subscribing
Returns the values of the subscription registrations and delivery lanes, in total.- Returns:
- the values of the subscription registrations and delivery lanes, in total
-
subscriptions
Returns the values of each subscription that the client holds, in no particular order. A subscription joins the list when its handle is returned, before the client processes its registration, and leaves it once its removal completes or it is closed; a handler that still runs then keeps its lane counted inClientStats.Subscribing.lanes(). Every snapshot collects these values, soMqttClient.stats()takes time in proportion to the subscriptions held.- Returns:
- the values of each subscription that the client holds, in no particular order
-
refusals
Returns lifetime counts of operations that the client refused for capacity, by the limit that refused them. The refused operations failed withMqttCapacityException.- Returns:
- lifetime counts of operations that the client refused for capacity, by the limit that refused them
-
overloads
Returns lifetime counts of connections that the client ended because it was overloaded, by cause. The ending of each such connection carries aMqttCapacityException.- Returns:
- lifetime counts of connections that the client ended because it was overloaded, by cause
-
droppedMetricEvents
public long droppedMetricEvents()Returns a lifetime count ofMetricsListenerevents dropped because the listener fell behind.- Returns:
- a lifetime count of
MetricsListenerevents dropped because the listener fell behind
-
equals
-
hashCode
-
toString
-