How to correlate the transaction ID in case of multiple
transactions
If your application has multiple transactions, each transaction
has its unique transaction ID. The transactions can be differentiated
by their transaction names, and their transaction IDs shall be
assigned with different parameters, so that each parameter will
correlate with its own transaction.
-
Add scripts in the Connect for capturing the transaction ID
and assign it to a parameter.A ConnectAndCreateTransaction request in a transaction named
“itr_dynamiccon” looks like the following:123456789101112131415161718192021web_custom_request("ConnectAndCreateTransaction_2","URL=<span><strong>http://192.168.178.125:5001/api/ServerApi/ConnectAndCreateTransaction</strong></span>","Method=<span><strong>POST</strong></span>","Resource=<span><strong>0</strong></span>","RecContentType=<span><strong>application/json</strong></span>","Referer=","Snapshot=<span><strong>t337.inf</strong></span>","Mode=<span><strong>HTTP</strong></span>","EncType=<span><strong>application/json</strong></span>;charset=<span><strong>UTF-8</strong></span>","Body=<span><strong>{</strong></span>"version":"1.0","requestid":"5D86818C-CAF5-49fe-B78A-4AC7AC550F88","appname":"psapi4loadrunner","namespace":"Psapi4loadrunner","session":"""<gs_SessionID>","type":7,"transaction":null,"content":{"connect""":{"cachegroup":"","cachename":"PostgreSQL","transactionname":"itr_dynamiccon","params":"""eyJ0aW1lc3RhbXAiOjE2MjUyMDg5MTEsInBheWxvYWQiOiJna21qUzVZY01RM294ZnJLVFNQQ1NyRFJuUENqTmxPTHZEeENGUlJ0MngrNW1WV3d2WFJNK3BCalRiMEFKY05EZm5iMFU5VVQ0ckhjdnRRQ0tubkV1Q29adlhoOExlRXZvaFhsSGJlMmQ1cFdRZzc2VnhLOGYwZHZlSDBGMVRBRTB6YU9zaEhuM2lKMGZEQkJSak1scXl1MThyUnM0OFlOY3dlMGY2ZGpHbWVvUGxmVU40RzM0MTcwMCtzbUh3Ung5ZUlIcnUvR2pRS0hkYmFFRWJyMlAxR2tMZVg4UE1wVlVtZTh5ektJWlRZZUVkSFBtd3crekpLNlJFeE9QMFFKVVdIVW4wajFKemh0MURYcW95VjlKMjJyam5CNVk3U1dBYy91UnRlQkxmUT0iLCJzaWduYXR1cmUiOiIyT2t2SGRIaWtoWGZzeXQvSHNhSUk4R3VzQj""M5OXJmbER1YzdTWEpkNjg1bDlxUjJJbkpzRGVVbTcxdVl6WHh0UGZFeTFGTFUzcDRjRWNWK2p1YWF0UT09In0="}}}",<span><strong>LAST</strong></span>);You need to add the following code above the
ConnectAndCreateTransaction request:-
Add a web_reg_save_param function above the request to
capture the transaction ID and assign it to the parameter
“gs_TransactionID_Dycache”. Here the parameter name has a
suffix “_Dycache” to identify the transaction
“itr_dynamiccon”.1web_reg_save_param("gs_TransactionID_Dycache","LB="transactionid":"","RB="},"content","Search=<span><strong>Body</strong></span>",<span><strong>LAST</strong></span>);
-
-
Replace the transaction ID with the parameter every time it
occurs.-
Identify the transaction ID that needs to be correlated.
You may do a global search in the script for the transaction
name “itr_dynamiccon” which follows the transaction ID. -
Replace every occurrence of the transaction ID with the
parameter <gs_TransactionID_Dycache>.
12345678910111213141516web_custom_request("RetrieveWithParm","URL=<span><strong>http://192.168.178.125:5001/api/ServerApi/RetrieveWithParm</strong></span>","Method=<span><strong>POST</strong></span>","Resource=<span><strong>0</strong></span>","RecContentType=<span><strong>application/json</strong></span>","Referer=","Snapshot=<span><strong>t338.inf</strong></span>","Mode=<span><strong>HTTP</strong></span>","EncType=<span><strong>application/json</strong></span>;charset=<span><strong>UTF-8</strong></span>","Body=<span><strong>{</strong></span>"version":"1.0","requestid":"81EDB9E2-CC47-4b68-B70A-09B46DD88261","appname":"psapi4loadrunner","namespace":"Psapi4loadrunner","session":"""<gs_SessionID>","type":1,"transaction":{"transactionid":"""<gs_TransactionID_Dycache>","transactionname":"itr_dynamiccon"},"content":{"retrieves":[{"retrieveid":"81EDB9E2-CC47-4b68-B70A-09B46DD88261","parent":"","dataobject":"d_customers","parentcolumn":"","isreport":false,"isdynamic":false,"dwsyntax":"","sql":"","processing":1,"arguments":[]}]}}",<span><strong>LAST</strong></span>); -