Adding instrumentation into request metrics flow
Certain applications might require additional instrumentation points
within the request metrics flow. For example, you may want to understand the
response time to a unique back-end system as seen in call graph below.
HTTP request /trade/scenario ------------------------------> 172 ms
Servlet/trade/scenario --------------------------------> 130 ms
Servlet/call to unique back-end system -------------------------->38 ms
Request Metrics uses a "token" or "correlator" when tracing the flow of
each request through the system. To create the call graph above with this
instrumentation, you must plug into that flow of the request and issue the
appropriate ARM API in order for an ARM agent to collect the data and for
the ARM vendor to create the call graph.
Request metrics exposes the Correlation Service API for you to plug into
the flow of the request. The following is one of the typical flows that may
be followed by an instrumented application in order to plug into the request
metrics flow:
- Create a new ArmTransaction object, which runs various instrumentation
calls such as start or stop. The Correlation Service Arm wrapper (PmiRmArmTx)
encapsulates this object before being injected into the request metrics flow.
- Populate the ArmTransaction object with an appropriate ArmCorrelator.
This object encapsulates the actual ARM correlator bytes.
- Run the start() method on the ArmTransaction object above, marking the
beginning of the instrumented method.
- Instantiate a PmiRmArmTx object using the static method on the PmiRmArmTxFactory
class, and populate it with the ArmTransaction object above.
- Pass the PmiRmArmTx object above to the Correlation Service by pushing
it onto the Correlation Service stack using exposed methods on the PmiRmArmStack
class.
- Perform the tasks that need to be done by the method being instrumented.
The Correlation Service takes care of flowing the ArmTransaction as necessary,
which eventually results in the call graph view of the transaction times.
- At the end of the instrumented method, access the PmiRmArmTx object from
the Correlation Service using exposed methods on the PmiRmArmStack class,
access the ArmTransaction objec,t and perform a stop to indicate the end of
the transaction.

Example: Using the correlation service interface
Searchable topic ID:
cprf_corrservinterface
Last updated: Jun 21, 2007 4:55:42 PM CDT
WebSphere Application Server Network Deployment, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/cprf_corrservinterface.html