public final class MessageLatencyManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageLatencyManager.MessagingDirection
Used with
update(com.neeve.sma.MessageView, com.neeve.sma.MessageLatencyManager.MessagingDirection) to indicate whether to update inbound or outbound related latencies |
static interface |
MessageLatencyManager.UpdateListener
Provides a listener callback that allows application to hook a listener
that is called once message latency stats have been updated for a
MessageView. |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
captureMsgLatencyStats
Deprecated.
|
static String |
PROP_MESSAGE_LATENCY_LEG_STATS
Property that enables recording of leg latencies as messages flow through the system.
|
static String |
PROP_MESSAGE_LATENCY_STATS
Deprecated.
Use
PROP_MESSAGE_LATENCY_LEG_STATS instead |
static boolean |
PROP_MESSAGE_LATENCY_STATS_DEFAULT
Deprecated.
Not used any more. Default value is now
Stats#recordLegLatencies |
static String |
PROP_MESSAGE_LATENCY_STATS_INTERVAL
Property that enables latency stats tracing
When set to a value greater than 0, message latency stats are traced at the specified
interval (in seconds).
|
static String |
PROP_MESSAGE_LATENCY_STATS_INTERVAL_DEFAULT
The default value for "nv.stats.trace.latency.messaging.interval" ("0" seconds)
|
static String |
PROP_MESSAGE_LATENCY_WAYPOINT_STATS
Property that enables recording of waypoints on messages flowing through the system.
|
static boolean |
PROP_MESSAGE_LATENCY_WAYPOINT_STATS_DEFAULT
The default value for "nv.stats.latency.waypoint.messaging.enabled" ()
|
static String |
PROP_MESSAGETYPE_LATENCY_LEG_STATS
Property that enables recording of leg latencies, per message type, as messages flow through the system.
|
static boolean |
PROP_MESSAGETYPE_LATENCY_LEG_STATS_DEFAULT
The default value for enabling "nv.stats.latency.leg.messaging.type.enabled" (false)
|
static String |
PROP_MESSAGETYPE_LATENCY_STATS
Deprecated.
Use
PROP_MESSAGETYPE_LATENCY_LEG_STATS instead |
static boolean |
PROP_MESSAGETYPE_LATENCY_STATS_DEFAULT
Deprecated.
Use
PROP_MESSAGETYPE_LATENCY_LEG_STATS_DEFAULT instead |
static boolean |
recordMsgLegLatencies
Indicates whether messaging leg latencies should be recorded as messages flow through the system
|
static boolean |
recordMsgLegWaypoints
Indicates whether messaging leg waypoint timestamps should be recorded on messages as they flow/progress through the system
|
static boolean |
recordMsgTypeLegLatencies
Indicates whether messaging leg latencies, per message type, should be recorded as messages flow through the system
|
| Constructor and Description |
|---|
MessageLatencyManager(MessageBusBinding binding,
String name)
Construct using the manager name
|
| Modifier and Type | Method and Description |
|---|---|
void |
calcAndRecordLegLatencies(MessageView view,
MessageLatencyManager.MessagingDirection direction)
Calculate and record messaging leg latencies on a message
|
MessageLatencyManager |
compute()
Compute derived stats from the current sample set.
|
StringBuilder |
get(StringBuilder sb,
boolean csv)
Format and stats into a string builder object
|
IStats.Latencies |
getCreateToSendLatencies()
The create to send latencies in microsends.
|
IStats.Latencies |
getDeserializeLatencies()
Get the d (deserialize) latencies in microseconds.
|
IStats.Latencies |
getDeserializeToReceiveLatencies()
Get the d2i (post-deserialize->receive) latencies in microseconds.
|
IStats.Latencies |
getOriginToReceiveLatencies()
Get the o2i (origin->receive) latencies in microseconds
The time in microseconds.from when the message was originally created to just after it was received.
|
IStats.Latencies |
getSendToPollLatencies()
The send to poll latencies in microseconds.
|
IStats.Latencies |
getSendToSerializeLatencies()
The send to serialize latencies in microsends.
|
IStats.Latencies |
getSerializeLatencies()
Get the serialize latencies in microseconds.
|
IStats.Latencies |
getSerializeToWireLatencies()
Get the s2w (post-serialize->pre-wire) latencies in microseconds.
|
IStats.Latencies |
getWireLatencies()
Get the w (wire) latencies in microseconds.
|
IStats.Latencies |
getWireSendLatencies()
Get the outbound 'ws' (wire send) latencies in microseconds.
|
IStats.Latencies |
getWireToDeserializeLatencies()
Get the w2d (wire->pre-deserialize) latencies in microseconds.
|
IStats.Latencies |
getWireToWireLatencies()
Get the w2w (wire->wire) latencies, for outbound messages the time from inbound message receipt off the wire to after
the outbound message was written to the wire.
|
String |
name()
Get the latency manager's name (must be unique system wide)
|
void |
reset()
Reset the latency manager
|
void |
setUpdateListener(MessageLatencyManager.UpdateListener listener)
Sets an
MessageLatencyManager.UpdateListener for this latency manager. |
void |
shutdown()
Shut down the latency stats manager
|
void |
start()
Starts dump of message latency stats (if stats interval is set)
|
void |
update(MessageView view,
MessageLatencyManager.MessagingDirection direction)
Deprecated.
|
public static final String PROP_MESSAGE_LATENCY_WAYPOINT_STATS
When set to true, the system records waypoint timestamps on messages as they flow through the system. Enabling this property can increase latency due to the overhead of recording timestamps.
Property Name: "nv.stats.latency.waypoint.messaging.enabled" Default Value:
public static final boolean PROP_MESSAGE_LATENCY_WAYPOINT_STATS_DEFAULT
public static final String PROP_MESSAGE_LATENCY_LEG_STATS
When set to true, the system records leg latencies of messages as they flow through the system. Enabling this property can increase latency due to the overhead of calculating leg latencies.
Property Name: "nv.stats.latency.leg.messaging.enabled" Default Value:
@Deprecated public static final String PROP_MESSAGE_LATENCY_STATS
PROP_MESSAGE_LATENCY_LEG_STATS instead@Deprecated public static final boolean PROP_MESSAGE_LATENCY_STATS_DEFAULT
Stats#recordLegLatenciespublic static final String PROP_MESSAGETYPE_LATENCY_LEG_STATS
When set to true, the system records leg latencies of messages, per message type as they flow through the system. Enabling this property can increase latency due to the overhead of calculating leg latencies.
Property Name: "nv.stats.latency.leg.messaging.type.enabled" Default Value: false
public static final boolean PROP_MESSAGETYPE_LATENCY_LEG_STATS_DEFAULT
@Deprecated public static final String PROP_MESSAGETYPE_LATENCY_STATS
PROP_MESSAGETYPE_LATENCY_LEG_STATS instead@Deprecated public static final boolean PROP_MESSAGETYPE_LATENCY_STATS_DEFAULT
PROP_MESSAGETYPE_LATENCY_LEG_STATS_DEFAULT insteadpublic static final String PROP_MESSAGE_LATENCY_STATS_INTERVAL
When set to a value greater than 0, message latency stats are traced at the specified interval (in seconds).
This setting has no effect if "nv.msg.latency.stats" is false
Property Name: "nv.stats.trace.latency.messaging.interval" Default Value: "0"
PROP_MESSAGE_LATENCY_STATS,
Constant Field Valuespublic static final String PROP_MESSAGE_LATENCY_STATS_INTERVAL_DEFAULT
public static final boolean recordMsgLegLatencies
public static final boolean recordMsgTypeLegLatencies
public static final boolean recordMsgLegWaypoints
@Deprecated public static final boolean captureMsgLatencyStats
recordMsgLegWaypointspublic MessageLatencyManager(MessageBusBinding binding, String name)
public final String name()
public final void start()
public final void setUpdateListener(MessageLatencyManager.UpdateListener listener)
MessageLatencyManager.UpdateListener for this latency manager.
The MessageLatencyManager.UpdateListener update listener is called each time
the latencies are updated for a message. This should only be
called once per message during normal application flow, but
in the event of redeliveries it is possible that the update
listener may be invoked more than once for a given MessageView.
public final void calcAndRecordLegLatencies(MessageView view, MessageLatencyManager.MessagingDirection direction)
@Deprecated public final void update(MessageView view, MessageLatencyManager.MessagingDirection direction)
public final MessageLatencyManager compute()
public final StringBuilder get(StringBuilder sb, boolean csv)
public final IStats.Latencies getCreateToSendLatencies()
The time from when the message was created until it was 'offered' to the bus binding for send.
A high value in this statistic may indicate that there may be some bottleneck or overhead prior to the message being sent or could be indicative of significant time spent populating the message.
public final IStats.Latencies getSendToPollLatencies()
The time from when the message was offered for send until the binding picks up the message for send. This statistic is useful for a binding offer in a detached mode and captures time the message is queued before delivery is started, when a binding is not operating in a detached mode this statistic is expected to be 0.
A high o2p may indicate that the bus binding is backed up by flow control or that the thread sending messages is cpu bound.
public final IStats.Latencies getSendToSerializeLatencies()
The time spent from the point at which the binding begins the send of the message until just before the binding is serialized into the underlying transport. A high value here indicates that there are delays in the bus binding code path prior to serialization.
public final IStats.Latencies getSerializeLatencies()
The serialize latencies in microsends, the spent serializing the MessageView to its transport encoding (aka: 's')
A high value here may indicate encoding innefficiences or large message payloads.
public final IStats.Latencies getSerializeToWireLatencies()
A high value here often indicates that the message is network bound (flow controlled).
public final IStats.Latencies getWireSendLatencies()
The time spent by the message bus provider writing the message to the wire. This time covers an time spent blocked in the provider due to flow control and time in the provider implementation's send api.
public final IStats.Latencies getWireLatencies()
The time spent on the wire from when the message was written to the transport by the sender to the time it was received by the receiver.
public final IStats.Latencies getWireToDeserializeLatencies()
The time from when the serialized form was received from the transport to deserialization.
public final IStats.Latencies getDeserializeLatencies()
The time (in microseconds) spent deserializing the message and wrapping it in a MessageView.
public final IStats.Latencies getDeserializeToReceiveLatencies()
This measure the time from when the bus has deserialized by the bus to when the app's engine picks it up from it's input queue (before it dispatches it to an application) handler.
Additional time spent by the engine dispatching the message to the application handler is covered by msgPreProcLatencies (mpproc).
public final IStats.Latencies getOriginToReceiveLatencies()
The time in microseconds.from when the message was originally created to just after it was received.
Note: that this stat is subject to clock skew when the creating and receiving sides are on different hosts.
public final IStats.Latencies getWireToWireLatencies()
For outbound messages the time from when the corresponding inbound message was received off the wire to when the outbound message was written to the wire. This measurement is useful for determine how long the process spent from receiving a message to making its effects to the world 'known'.
public final void reset()
public final void shutdown()
Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.