DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How Relevant Is Chaos Engineering Today?
  • Ending Microservices Chaos: How Architecture Governance Keeps Your Microservices on Track
  • ChaosMeta for AI: Taking AI Stability to the Next Level With Chaos Engineering
  • Injecting Chaos: Easy Techniques for Simulating Network Issues in Redis Clusters

Trending

  • Performance Optimization Techniques for Snowflake on AWS
  • Streamlining Event Data in Event-Driven Ansible
  • Contextual AI Integration for Agile Product Teams
  • AI, ML, and Data Science: Shaping the Future of Automation

How to Perform Chaos Testing in LoadRunner Using Gremlin

This post will detail the steps on how to run chaos experiments in LoadRunner Professional using Gremlin integration.

By 
NaveenKumar Namachivayam user avatar
NaveenKumar Namachivayam
DZone Core CORE ·
Updated Apr. 21, 22 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
4.0K Views

Join the DZone community and get the full member experience.

Join For Free

Chaos testing is a subset of chaos engineering. Think of performance testing as a subset of performance engineering. Simply put, you break things on purpose and learn how you can make your systems reliable.

Gremlin Integration with LoadRunner Professional 2022

To integrate Gremlin with LoadRunner Professional 2022, the following prerequisites are required:

  • LoadRunner Professional 2022
  • Gremlin account (which is free)
  • Sample application
  • Server with Gremlin installed

To demonstrate the integration, let us use an EC2 instance on AWS with nginx installed on your favorite Linux distro.

nginx on EC2

Login to your AWS console and spin up an instance. In this example, let us use Ubuntu. Once the instance is spanned up, SSH into it to install nginx and Gremlin.

$ sudo apt update -y

$ sudo apt install nginx -y

Launch http://<ec2_ip_address> to view the nginx home page. If you do not see the nginx home page as below, please validate the security groups.

nginx demo app
Security Group

Gremlin Installation Steps

The next step is to download and install Gremlin on the Linux box. Login to your Gremlin account. On the home page, you can find the steps to follow.

After successful installation, let us configure the Gremlin Control Plan using the Team ID and Secret Key.

Enter the below command and hit enter to copy the Team ID and Secret Key.

$ gremlin init

To grab the Team ID, go to your Company > Team > Configuration.

To grab a Secret Key, check your registered email ID or you can reset it.

Gremlin Configuration

Gremlin Configuration

Once the configuration is successful, you should get the below success message.

Gremlin Identifier

Creating a Scenario in Gremlin

Before we create a script in VuGen, let us create a scenario in Gremlin. Go to your Dashboard, click the Create Scenario button as shown below.

Create Scenario

Let us attack the CPU of a Linux box where nginx is running. Name your scenario, select the target hosts, select the Category as Resource, and Attack as CPU.

The length of the attack is 300 seconds, CPU capacity is 100%, and targets all the cores.

Click Add to Scenario, then Save Scenario.

Attack Configuration

Scenario Details

Creating LoadRunner Script

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

HTTP
 
	lr_start_transaction("T00_HomePage");


        // Replace the EC2 IP address

	web_custom_request("web_custom_request",
		"URL=http://EC2_IP_ADDRESS",
		"Method=GET",
		"TargetFrame=",
		"Resource=0",
		"Referer=",
		"Body=",
		LAST);

	lr_end_transaction("T00_HomePage", LR_AUTO);


Compile and run the script to validate the request. Let us configure the pacing as shown below in Runtime Settings.

Runtime Settings
Runtime Settings

Close VuGen and launch Controller.

Designing a Scenario in Controller 2022

Upon launching the Controller, add the above-created script as shown below.

New Scenario in Controller

To add a disruption event, click on Disruption Events as shown below under Scenario Schedule in the Design tab.

Disruption Events

Click on the Add Event button to configure the API Key, Team ID, and other details.

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

Paste your API Key and Team ID as shown below and click Add. After adding the API key and team ID, the created scenario in Gremlin should be displayed as shown below.

Add Event

Before you click Save, configure the start time as shown below. The end time will be automatically configured. The CPU attack will get started in the third minute and will last for a minute.

Disruption Events

Below is the Global Schedule that we are going to run.

Global Schedule

Save the Controller scenario before you hit Run.

Running a Chaos Experiment

Before you start running the scenario in the Controller, go to your EC2 instance, enter top command to monitor the CPU utilization.

Experiment Objective

The above experiment will validate the response time of nginx server for 50 users under high CPU utilization.

Click on the Run button to get started and monitor the graphs in the Controller.

Before the CPU Attack

During the CPU Attack

CPU Attack

After the CPU Attack

After CPU Attack

Here is the complete graph of our test where I highlighted the response time during the CPU attack. There is a slight elevation in the response time graph during high CPU utilization. After the attack, the response time trend reverted.

Response Time Vs Time
Response Time Vs. Time

Congratulations! You have successfully executed a chaos experiment using Gremlin in LoadRunner Professional 2022.

After the experiment, make sure you terminate the instance on AWS, otherwise, it will accrue charges.

Conclusion

Though it is a tech preview, the positive scenarios are working fine without any issues. Using the free tier in Gremlin, you can perform various experiments. Based on your requirement, you can define the blast radius and break things on purpose in a controlled manner on production. Integration with LoadRunner makes performance testers' efforts easy and effective.

LoadRunner Chaos Gremlin (query language)

Published at DZone with permission of NaveenKumar Namachivayam, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How Relevant Is Chaos Engineering Today?
  • Ending Microservices Chaos: How Architecture Governance Keeps Your Microservices on Track
  • ChaosMeta for AI: Taking AI Stability to the Next Level With Chaos Engineering
  • Injecting Chaos: Easy Techniques for Simulating Network Issues in Redis Clusters

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!