Can #httprecorder output time stamp of interception for each event (request and response) it records?
I can't find any interception time related field in the recorded RR pairs information panel to indicate exact time the request/response is recorded.
This is very important for me to try to put all RR events recorded in multiple recorders in a single time line graph.
When stitching is a major concern, I always ask for a sequence diagram of the transaction flow. These diagrams are not always perfect, but it is easier to verify flow and identify the anomalies based on the recording.
I don't believe there is an approach for doing this since each recorder is essentially stateless and independent of the other. Adding logic to record & store the request / response time as MetaData via a Scriptable DPH is too late since DPHs do not execute until the recording is 'closed'; hence, time is DPH processing time not actual occurrence time.
If you have CA Application Insight agents installed on the app server(s), you might get a better idea of the sequencing using CAIs graphical display of the flow. There is a technique for creating services using CAI transaction frames.
If you were to create your own custom recorder (e.g., one or more VSMs that router requests to live backend systems and record the in/out as R/R pairs to the file system) you could include a time value in the MetaData and perhaps, make input request time be the start of your R/R pair key (e.g, yyyyMMddHHmmssSSS_operationName-req.txt & <same key>-rsp.txt). Based on TPS expectation, you would likely do this on a performance enabled VSE so the service adds minimal throughput overhead, but I suppose multiple VSMs might accomplish the same thing on a functional VSE.
Joe, thanks to your reply. That's very helpful.
1. I don't have sequence diagrams of the transaction flow. To my knowledge, it was not required to create one during development.
2. We don't have CA Application Insight agents installed in app servers.
3. It's not a customized recorder. Can I make one between a client and soap web service to enable time stamp?
4. It seems that it is technically difficult for CA to add a recorder feature to output time stamp of message interception.
So I guess it leaves me to the painful way of digging into log entries and assigning logged time stamp to each event(request and response).
Please do not take the attachments As-Is. Consider this an untested example that conceptualizes how you could use a VSM to record traffic. The VSM attempts to handle HTTP (NO HTTP/S) for both webservices and Rest calls. I don't know exactly how query strings on the URI would process in this example as they might strip out as Arguments.
Run in ITR mode, send a request, let the service route and examine the ITR Properties and Events to get a view of how it might work.
The VSM flow demonstrates how you might record and create R/R pairs.
The R/R pair member name includes a timestamp (filtered on the Listen step when request arrives).
Additional logic in the Listen Step (review Filters) stores the request body and provides an example of dynamically setting the Endpoint Host & Port by examining the operation.
When the response comes back from the endpoint, it is returned to the client.
A Scripted Assertion stores off the response.
A few extra steps try to set up a proper REST request pair and then save the Request & Response to a file.
The timestamp occurs as the first element of the filename so sorting in Windows Explorer enables one to align requests based on time.
The incoming request and outgoing response are stored with a filename of <timestamp>_<operationName> followed by the traditional -req.txt and -rsp.txt elements.
Sorting on timestamp in the file system directory sorts the requests in the order they were received by the VSM(s).
I supply no warranties. This is just an example that everyone can play with at their own risk.
It is theoretically possible to set up one VSM with routing or multiple VSMs each pinned to a specific endpoint.
If running the VSM in a functional VSE, you may experience performance issues.
This setup is not intended to support 000's of request/response calls.
If you send too high a number of calls, you are likely to get lost in the details of figuring out the flow.
EDIT: Removed VSM from this post and reattached due to updates below.
Thank you very much, Joel
It looks a hopeful solutions. I am new to SV. I will need some time to digest it and try to implement it.
I will let you know if I am successful.
As mentioned. If the request is RESTful and contains a Query String, you may need to supply additional logic.
The REST DPH, at the start of the Listen Step, will strip the Query String key/values and create arguments. In this case when the request is RESTful and has a query string, the script logic needs to save the original URI held by lisa_vse_http_current_transaction. The getRequestedURI() method pulls the unparsed resource, but it does NOT contain the method (i.e., GET, POST, etc.). You will need some extra logic so the REST Request written to disk is properly formed. A hacked out example is attached.
Thank you, Joel