|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.sma.MessageLatencyManager
public final class MessageLatencyManager
Stores cross-stack message latencies.
Nested Class Summary | |
---|---|
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 . |
Field Summary | |
---|---|
static boolean |
captureMsgLatencyStats
Contains whether messaging related latencies should be captured |
static String |
PROP_MESSAGE_LATENCY_STATS
Property that enabled message latency stats tracking. |
static boolean |
PROP_MESSAGE_LATENCY_STATS_DEFAULT
The default value for enabling "nv.msg.latency.stats" (false) |
static String |
PROP_MESSAGE_LATENCY_STATS_INTERVAL
When set to a value greater than 0 in seconds message latency stats are traced at the provided interval. |
static String |
PROP_MESSAGE_LATENCY_STATS_INTERVAL_DEFAULT
The default value for "nv.msg.latency.stats.interval" ("0" seconds) |
static String |
PROP_MESSAGETYPE_LATENCY_STATS
Property that enabled per message type latency stats tracking. |
static boolean |
PROP_MESSAGETYPE_LATENCY_STATS_DEFAULT
The default value for enabling "nv.msg.latency.stats" (false) |
Constructor Summary | |
---|---|
MessageLatencyManager(MessageBusBinding binding,
String name)
Construct using the manager name |
Method Summary | |
---|---|
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)
Update message latencies |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_MESSAGE_LATENCY_STATS
When set to true timings for messages are captured as they flow through the system. Enabling this property can increase latency due to the overhead of tracking timestamps.
Property Name: "nv.msg.latency.stats" Default Value: false
public static final boolean PROP_MESSAGE_LATENCY_STATS_DEFAULT
public static final String PROP_MESSAGE_LATENCY_STATS_INTERVAL
This setting has no effect if "nv.msg.latency.stats" is false
Property Name: "nv.msg.latency.stats.interval" Default Value: "0"
PROP_MESSAGE_LATENCY_STATS
,
Constant Field Valuespublic static final String PROP_MESSAGE_LATENCY_STATS_INTERVAL_DEFAULT
public static final String PROP_MESSAGETYPE_LATENCY_STATS
When set to true timings for each message type are individual tracked as separate stats. This can be useful in tracking down issues in which a particular message type is problematic (for example tracking down a high application handler message processing time).
Property Name: "nv.msgtype.latency.stats" Default Value: false
public static final boolean PROP_MESSAGETYPE_LATENCY_STATS_DEFAULT
public static final boolean captureMsgLatencyStats
Constructor Detail |
---|
public MessageLatencyManager(MessageBusBinding binding, String name)
Method Detail |
---|
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 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |