Package io.mats3.api.intercept
Interface CommonCompletedContext
- All Known Subinterfaces:
MatsInitiateInterceptor.InitiateCompletedContext
,MatsStageInterceptor.StageCompletedContext
public interface CommonCompletedContext
Common part of the interface of
MatsInitiateInterceptor.InitiateCompletedContext
and MatsStageInterceptor.StageCompletedContext
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionlong
long
long
long
long
long
-
Method Details
-
getTotalExecutionNanos
long getTotalExecutionNanos()- Returns:
- time taken (in nanoseconds) from initiate(..) was invoked, or the incoming message was received for a
Stage, to everything is finished and committed (i.e. basically "at exit" of initiate(..), or right before
going back up to the receive-loop for a Stage). This should pretty much be the sum of "all of the below",
i.e.
getUserLambdaNanos()
+getSumEnvelopeSerializationAndCompressionNanos()
+getDbCommitNanos()
+getSumMessageSystemProductionAndSendNanos()
+getMessageSystemCommitNanos()
, PLUS, for Stages, the message reception timingsMatsStageInterceptor.StageCommonContext.getTotalPreprocessAndDeserializeNanos()
(which again are decomposed).
-
getUserLambdaNanos
long getUserLambdaNanos()- Returns:
- time taken (in nanoseconds) to run the user supplied initiate lambda itself, from entry to exit. Any time
taken by invoking message-resulting methods, e.g.
processContext.request()
, which in the current JMS implementation of Mats involves creating the envelope including serializing the state and message DTO, will thus also count toward this time (these timings are separately available inMatsOutgoingMessage.MatsSentOutgoingMessage.getEnvelopeProduceNanos()
). If the user lambda includes database access (e.g. a SELECT and/or UPDATE), this timing should probably be dominated by this. If there areMatsInitiateInterceptor.MatsInitiateInterceptUserLambda
s involved, the interceptor(s) might have added some overhead both by the interception, and by potentially having wrapped theMatsInitiator.MatsInitiate
instance.
-
getMeasurements
List<CommonCompletedContext.MatsMeasurement> getMeasurements() -
getTimingMeasurements
List<CommonCompletedContext.MatsTimingMeasurement> getTimingMeasurements() -
getSumEnvelopeSerializationAndCompressionNanos
long getSumEnvelopeSerializationAndCompressionNanos()- Returns:
- time taken (in nanoseconds) to serialize the Mats envelope(s), should basically be the sum of any
outgoing
messages'MatsOutgoingMessage.MatsSentOutgoingMessage.getEnvelopeSerializationNanos()
plusMatsOutgoingMessage.MatsSentOutgoingMessage.getEnvelopeCompressionNanos()
.
-
getDbCommitNanos
long getDbCommitNanos()- Returns:
- time taken (in nanoseconds) to commit the database. Will be
0
if thisMatsFactory
is not configured with SQL transaction management, and will hopefully be very low if "SQL transaction elision" is in effect (i.e. that the initiate didn't perform any SQL), but never0
- that is, you may use the 0 to check whether SQL transaction management was in effect or not.
-
getSumMessageSystemProductionAndSendNanos
long getSumMessageSystemProductionAndSendNanos()- Returns:
- time taken (in nanoseconds) to produce, and then send (transfer) the message(s) to the message broker,
should basically be the sum of any
outgoing
messages'MatsOutgoingMessage.MatsSentOutgoingMessage.getMessageSystemProduceAndSendNanos()
. - See Also:
-
getMessageSystemCommitNanos
long getMessageSystemCommitNanos()- Returns:
- time taken (in nanoseconds) to commit the MQ system. If the initiation didn't actually send any messages,
MQ transaction elision might kick in, and this number may become very low or
0
.
-
getThrowable
- Returns:
- any Throwable that was raised during the initiation/stage, meaning that the initiation/stage failed.
-
getOutgoingMessages
List<MatsOutgoingMessage.MatsSentOutgoingMessage> getOutgoingMessages()- Returns:
- the resulting full list of outgoing messages that was sent in this initiation/stage context. (For Stages, this contains all messages, including any reply, next or gotos, any request(s), and initiated messages - for which there are separate methods to get in separate lists/Optional.)
-