Thread Dump

Thread dumps are only for java processes.

Commands to take thread dump:

  • jstack -l  <pid> > threaddump.txt
  • kill -3 <pid>
  • jcmd <pid> Thread.print > <file-path>

Thread Analysis:

Thread dumps should be taken multiple times to get exact issue and one dump is not sufficient and may mislead the investigation. We should atleast take 3-5 thread dumps at an interval of 10 secs.30 sec or 1 minutes as per the performance issue.

To analyse, take the thread dumps and upload the files in site - fastThread Java Thread Dump Analyzer

Thread Status:

  • NEW: The thread is created but has not been processed yet.
  • RUNNABLE: The thread is occupying the CPU and processing a task. (It may be in WAITING status due to the OS's resource distribution.)
  • BLOCKED: The thread is waiting for a different thread to release its lock in order to get the monitor lock.
  • WAITING: The thread is waiting by using a wait, join or park method.
  • TIMED_WAITING: The thread is waiting by using a sleep, wait, join or park method. (The difference from WAITING is that the maximum waiting time is specified by the method parameter, and WAITING can be relieved by time as well as external changes.) 


Scripting Web Services in Load Runner


Below are the steps to follow for scripting web services to load testing.
  • Get WSDL - Also called endpoint
  • Get Request XML - Also called request payload
  • Test in SOAP UI/POSTMAN - Test manually if proper response payload in fetched
  • Open Load Runner. Open new script with protocol as Web Services.
  • Go to Action page.
  • Go to View in Menu bar, click Step ToolBox.
  • Search web_customer_request.
Fill the below details:
METHOD: POST
POST requests supply additional data from the client (browser) to the server in the message body. In contrast, GET requests include all required data in the URL.
URL : your wsdl
Body: Copy and paste entire request. select all and right. Convert to C.

Click OK.

  • Now add below line above your web_custom_request:

web_reg_save_param("c_response","LB=<responseCode>","RB=</responseCode>","ORD=1");
lr_start_transaction("client_project_application_transaction_name");

After this will be your web_custom_request code:
web_custom_request("web_custom_request",
.
.
.
"</soapenv:Envelope>",
LAST);


  • Finally below code to check if you received pass response code or failed. You can add more validation in request response.

if (strcmp (lr_eval_string("{c_response}"),"3001") == 0)
        {
           lr_end_transaction("ngcc_bcm_retrieve_voucher_info", LR_PASS);
           
        }

else
{
lr_end_transaction("ngcc_bcm_retrieve_voucher_info",LR_FAIL);
  //lr_output_message ( "Response Ticket#%s", lr_eval_string ( "{c_ticket}" ) );

            lr_continue_on_error( 0 );
            lr_exit( LR_EXIT_ITERATION_AND_CONTINUE, LR_FAIL );
}