public class LocalStatsMatsInterceptor extends java.lang.Object implements MatsStageInterceptor.MatsStageInterceptOutgoingMessages, MatsInitiateInterceptor.MatsInitiateInterceptOutgoingMessages
LocalHtmlInspectForMatsFactory
.
To install, invoke the install(MatsInterceptable)
method, supplying the MatsFactory. The report generator
will fetch the interceptor from the MatsFactory.
Implementation note: Mats allows Initiators and Endpoints to be defined "runtime" - there is no specific setup
time vs. run time. This implies that the set of Endpoints and Initiators in a MatsFactory can increase from one run
of a report generation to the next (Endpoint may even be deleted, but this is really only meant for testing).
Moreover, this stats collecting class only collects stats for Initiators and Endpoints that have had traffic, since
it relies on the interceptors API. This means that while the MatsFactory might know about an Initiator or an
Endpoint, this stats class might not yet have picked it up. This is why all methods return Optional. On the other
hand, the set of Stages of an endpoint cannot change after it has been finishedSetup()
(and it cannot be start()
'ed before it has been
finishedSetup()
) - thus if e.g. only the initial stage of an Endpoint has so far seen traffic, this
class has nevertheless created stats objects for all of the Endpoint's stages.Modifier and Type | Class and Description |
---|---|
static interface |
LocalStatsMatsInterceptor.EndpointStats |
static class |
LocalStatsMatsInterceptor.EndpointStatsImpl |
static interface |
LocalStatsMatsInterceptor.IncomingMessageRepresentation |
static class |
LocalStatsMatsInterceptor.IncomingMessageRepresentationImpl |
static interface |
LocalStatsMatsInterceptor.InitiatorStats |
static interface |
LocalStatsMatsInterceptor.MessageRepresentation |
static interface |
LocalStatsMatsInterceptor.OutgoingMessageRepresentation |
static class |
LocalStatsMatsInterceptor.OutgoingMessageRepresentationImpl |
static interface |
LocalStatsMatsInterceptor.StageStats |
MatsStageInterceptor.MatsStageInterceptOutgoingMessages, MatsStageInterceptor.MatsStageInterceptUserLambda, MatsStageInterceptor.StageCommonContext, MatsStageInterceptor.StageCompletedContext, MatsStageInterceptor.StageInterceptContext, MatsStageInterceptor.StageInterceptOutgoingMessageContext, MatsStageInterceptor.StageInterceptUserLambdaContext, MatsStageInterceptor.StagePreprocessAndDeserializeErrorContext, MatsStageInterceptor.StageReceivedContext
MatsInitiateInterceptor.InitiateCompletedContext, MatsInitiateInterceptor.InitiateInterceptContext, MatsInitiateInterceptor.InitiateInterceptOutgoingMessagesContext, MatsInitiateInterceptor.InitiateInterceptUserLambdaContext, MatsInitiateInterceptor.InitiateStartedContext, MatsInitiateInterceptor.MatsInitiateInterceptOutgoingMessages, MatsInitiateInterceptor.MatsInitiateInterceptUserLambda
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUM_SAMPLES |
static java.lang.String |
EXTRA_STATE_ENDPOINT_ENTER_NANOS |
static java.lang.String |
EXTRA_STATE_ENDPOINT_ENTER_NODENAME |
static java.lang.String |
EXTRA_STATE_OR_SIDELOAD_INITIATOR_NANOS |
static java.lang.String |
EXTRA_STATE_OR_SIDELOAD_INITIATOR_NODENAME |
static java.lang.String |
EXTRA_STATE_REQUEST_NANOS |
static java.lang.String |
EXTRA_STATE_REQUEST_NODENAME |
static int |
MAX_NUMBER_OF_DYNAMIC_ENTRIES
This is an Out Of Memory avoidance in case of wrongly used initiatorIds.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
stageCompletedNextDirect, stagePreprocessAndDeserializeError
initiateStarted
public static final int DEFAULT_NUM_SAMPLES
public static final int MAX_NUMBER_OF_DYNAMIC_ENTRIES
public static final java.lang.String EXTRA_STATE_REQUEST_NANOS
public static final java.lang.String EXTRA_STATE_REQUEST_NODENAME
public static final java.lang.String EXTRA_STATE_ENDPOINT_ENTER_NANOS
public static final java.lang.String EXTRA_STATE_ENDPOINT_ENTER_NODENAME
public static final java.lang.String EXTRA_STATE_OR_SIDELOAD_INITIATOR_NANOS
public static final java.lang.String EXTRA_STATE_OR_SIDELOAD_INITIATOR_NODENAME
public static LocalStatsMatsInterceptor install(MatsInterceptable matsInterceptableMatsFactory)
MatsInterceptable
(which most
probably is a MatsFactory
). Note that this interceptor is stateful wrt. the MatsFactory, thus a new
instance is needed per MatsFactory - which is fulfilled using this method. It should only be invoked once per
MatsFactory. You get the created interceptor in return, but that is not needed when employed with
LocalHtmlInspectForMatsFactory
, as that will fetch the instance from the MatsFactory using
MatsInterceptable.getInitiationInterceptor(Class)
.matsInterceptableMatsFactory
- the MatsInterceptable
MatsFactory to add it to.public java.util.Optional<LocalStatsMatsInterceptor.InitiatorStats> getInitiatorStats(MatsInitiator matsInitiator)
public java.util.Optional<LocalStatsMatsInterceptor.EndpointStats> getEndpointStats(MatsEndpoint<?,?> matsEndpoint)
public java.util.Optional<LocalStatsMatsInterceptor.StageStats> getStageStats(MatsStage<?,?,?> matsStage)
public void initiateInterceptOutgoingMessages(MatsInitiateInterceptor.InitiateInterceptOutgoingMessagesContext context)
initiateInterceptOutgoingMessages
in interface MatsInitiateInterceptor.MatsInitiateInterceptOutgoingMessages
public void initiateCompleted(MatsInitiateInterceptor.InitiateCompletedContext context)
initiateCompleted
in interface MatsInitiateInterceptor
public void stageReceived(MatsStageInterceptor.StageReceivedContext i_context)
MatsStageInterceptor
MatsStageInterceptor.stagePreprocessAndDeserializeError(StagePreprocessAndDeserializeErrorContext)
is invoked instead).stageReceived
in interface MatsStageInterceptor
public void stageInterceptOutgoingMessages(MatsStageInterceptor.StageInterceptOutgoingMessageContext context)
stageInterceptOutgoingMessages
in interface MatsStageInterceptor.MatsStageInterceptOutgoingMessages
public void stageCompleted(MatsStageInterceptor.StageCompletedContext context)
MatsStageInterceptor
MatsStageInterceptor.MatsStageInterceptOutgoingMessages
.stageCompleted
in interface MatsStageInterceptor
MatsStageInterceptor.stageCompletedNextDirect(StageCompletedContext)