In my final submit, I listed out the new features of LoadRunner Professional 2022. One of many tech preview options in LoadRunner 2022 is Chaos Testing with Gremlin. This weblog submit will element the steps to operating chaos experiments in LoadRunner Skilled utilizing Gremlin integration.

What’s Chaos Engineering?

Merely put, you break issues on objective and study how one can make your methods dependable. I urge you to verify this wonderful web page from Gremlin, https://www.gremlin.com/chaos-engineering/?ref=qainsights

Chaos testing is a subset of chaos engineering. Consider efficiency testing as a subset of efficiency engineering.

Gremlin Integration with LoadRunner Skilled 2022

To combine Gremlin with LoadRunner Skilled 2022, following are the conditions required:

  • LoadRunner Skilled 2022
  • Gremlin account (which is free)
  • Pattern software
  • Server with Gremlin put in

To show the combination, allow us to use an EC2 occasion on AWS with nginx put in in your favourite Linux distro.

nginx on EC2

Login to your AWS console and spin up an occasion. On this instance, allow us to use Ubuntu. As soon as the occasion is spanned up, SSH into it to put in nginx and Gremlin.

$ sudo apt replace -y

$ sudo apt set up nginx -y

Launch http://<ec2_ip_address> to view the nginx residence web page. If you don’t see the nginx residence web page as under, please validate the safety teams.

nginx demo app
nginx demo app

Security Group
Safety Group

Gremlin Set up Steps

The subsequent step is to obtain and set up Gremlin on the Linux field. Login to your Gremlin account. On the house web page, you could find the steps to comply with.

After profitable set up, allow us to configure the Gremlin Management Plan utilizing the Crew ID and Secret Key.

Enter the under command and hit enter to repeat the Crew ID and Secret Key.

$ gremlin init

To seize the Crew ID, go to your Firm > Crew > Configuration.

To seize a Secret Key, verify your registered e-mail ID or you possibly can reset it.

Gremlin Configuration
Gremlin Configuration

As soon as the configuration is profitable, you need to get the under success message.

Gremlin Identifier
Gremlin Identifier

Making a State of affairs in Gremlin

Earlier than we create a script in VuGen, allow us to create a situation in Gremlin. Go to your Dashboard, click on the Create State of affairs button as proven under.

Create Scenario
Create State of affairs

Allow us to assault the CPU of a Linux field the place nginx is operating. Title your situation, choose the goal hosts, choose the Class as Useful resource, and Assault as CPU.

The size of the assault is 300 seconds, CPU capability as 100%. and goal all of the cores.

Click on Add to State of affairs, then Save State of affairs.

Attack Configuration
Assault Configuration

Scenario Details
State of affairs Particulars

Creating LoadRunner Script

Launch VuGen to create a Web HTTP/HTML protocol script and add the under code in Motion.

   lr_start_transaction("T00_HomePage");


        // Substitute the EC2 IP tackle

    web_custom_request("web_custom_request",
        "URL=http://EC2_IP_ADDRESS",
        "Technique=GET",
        "TargetFrame=",
        "Useful resource=0",
        "Referer=",
        "Physique=",
        LAST);

    lr_end_transaction("T00_HomePage", LR_AUTO);

Compile and run the script to validate the request. Allow us to configure the pacing as proven under in Runtime Settings.

Runtime Settings
Runtime Settings

Shut VuGen and launch Controller.

Designing a situation in Controller 2022

Upon launching the Controller, add the above created script as proven under.

New Scenario in Controller
New State of affairs in Controller

So as to add a disruption occasion, click on on Disruption Occasions as proven under beneath State of affairs Schedule within the Design tab.

Disruption Events
Disruption Occasions

Click on on the Add Occasion button to configure the API Key, Crew ID, and different particulars.

To generate an API Key from Gremlin, go to your Account Settings > API Keys > New API Key. Enter a legitimate title and click on Save.

Paste your API Key and Crew ID as proven under and click on Add. After including the API key and crew ID, the created situation in Gremlin ought to be displayed as proven under.

Add Event
Add Occasion

Earlier than you click on Save, configure the beginning time as proven under. The tip time will likely be robotically configured. The CPU assault will get began within the third minute and can final for a minute.

Beneath is the International Schedule which we’re going to run.

Global Schedule
International Schedule

Save the Controller situation earlier than you hit Run.

Operating Chaos Experiment

Earlier than you begin operating the situation within the Controller, go to your EC2 occasion, enter prime command to watch the CPU utilization.

Creating chaos experiments is a mix of artwork and science.

– myself 🙂

Experiment Goal

The above experiment will validate the response time of nginx server for 50 vusers beneath the excessive CPU utilization.

Click on on the Run button to get began and monitor the graphs within the Controller.

Earlier than the CPU Assault

Through the CPU Assault

CPU Attack
CPU Assault

After the CPU Assault

After CPU Attack
After CPU Assault

Right here is the whole graph of our check the place I highlighted the response time through the CPU assault. There’s a slight elevation within the response time graph throughout excessive CPU utilization. After the assault, the response time development reverted.

Response Time Vs Time
Response Time Vs Time

Congratulations! You will have efficiently executed a chaos experiment utilizing Gremlin in LoadRunner Skilled 2022.

After the experiment, be sure you terminate the occasion on AWS, in any other case it is going to accrue costs.

Conclusion

Although it’s a tech preview, the constructive eventualities are working effective with none points. Utilizing the free tier in Gremlin, you possibly can carry out numerous experiments. Based mostly in your requirement, you possibly can outline the blast radius and break issues on objective in a managed method on manufacturing. Integration with LoadRunner makes efficiency testers effort straightforward and efficient.



Abu Sayed is the Best Web, Game, XR, Blockchain Developer, Producer and Singer in Bangladesh. Don't forget to Checkout his Latest Songs.


Read More