Logo

dev-resources.site

for different kinds of informations.

Getting Started with Predator - ruthless API performance testing

Published at
5/14/2020
Categories
testing
performancetesting
opensource
docker
Author
qainsights
Author
10 person written this
qainsights
open
Getting Started with Predator - ruthless API performance testing

This blog post originally appeared on my blog QAInsights.com

There are lot of tools, solutions, and framework is available for performance testing. The most well-known tools such as Apache JMeter, Micro Focus LoadRunner, Gatling, Neotys NeoLoad etc., has large user base and community. When I was browsing thru chaos engineering, I landed to predator.dev page accidentally. Later I spent half-a-day to explore about Predator and its features. This blog will feature Predator and how to get started with performance testing using Docker.

What is Predator?

Predator is free, open-source, and distributed load testing tool especially for APIs performance testing. The team behind Predator is PayU. Predator supports installation in Docker, Kubernetes, and DC/OS.

You can run unlimited tests using unlimited resources with unlimited threads/virtual users. Because you will be using your own infrastructure for performance testing.

I am not going to compare Predator with other tools’ features. Each tool comes with its own set of features and limitations.

More technical definition

Predator is an open-source performance framework we created for ourselves. We were fed up with the limitations of out-of-the-box solutions and the complication of writing complex custom tests. We designed Predator to manage the entire lifecycle of stress-testing a server, from creating a test file, to running scheduled and on-demand tests, and finally viewing the test results. Bootstrapped with a user-friendly UI alongside a simple REST API, Predator helps developers simplify the performance testing regime.

On-boarding

Installing Predator is quite simple if you are already experienced in Docker or k8s or DC/OS.

For Docker:

w/o persistent storage, fire the below command

docker run -d -e JOB_PLATFORM=DOCKER -e INTERNAL_ADDRESS=http://$MACHINE_IP:80/v1 -p 80:80 --name predator -v /var/run/docker.sock:/var/run/docker.sock zooz/predator

w/ persistent storage, use

docker run -d -e SQLITE_STORAGE=db/predator -e JOB_PLATFORM=DOCKER -e INTERNAL_ADDRESS=http://$MACHINE_IP:80/v1 -p 80:80 --name predator -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/predator:/usr/db zooz/predator

After successful installation, you can access the UI at http://localhost/UI or http://{$MACHINE_IP}/ui

For Kubernetes:

You can install Predator using the Helm.

helm repo add zooz https://zooz.github.io/helm/

helm install zooz/predator --version 1.3

For DC/OS:

Install thru Universe https://universe.dcos.io/#/package/predator/version/latest within the cluster.

Getting Started

To get started, I will be running Predator in Docker in Windows 10 Pro. After successful installation, Predator will be up and running in http://localhost/ui

Getting Started with Predator - ruthless API performance testing
Getting Started with Predator - ruthless API performance testing

This is how homepage looks. The user interface is built using React framework.

Predator Home Page
Predator Home Page

Before you start your first test, make sure the Settings are properly configured. Internal address should point to local IP address if you are running Predator locally.

Predator Configuration
Predator Configuration

In Settings page, you can configure Benchmarks, SMTP, Metrics, Resource configuration, and you can also do housekeeping the containers.

Sample Demo Application

Before we begin creating our first test, let us install sample pet store from Swagger docker.

docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_URL=http://localhost -e SWAGGER_BASE_PATH=/v2 -p 3001:8080 swaggerapi/petstore

I am using the port 3001 to install the Swagger pet store. Below is my sample API call to the pet’s details.

Sample Demo
Sample Demo

Predator does come with sample pet store docker image. But for me it did not work, hence I installed Swagger pet store.

First Test

To create your first test, click on Tests and then click on Create Test.

Predator Tests
Predator Tests

Let us test our demo API http://{machineip}:3001/v2/pet/10 by configuring below details in Test and then hit Submit. This will create a test and displays it in the Tests page.

You can create multiple scenarios and multiple API calls based on your test strategy.

Create Test in Predator
Create Test in Predator

To run the test, click on Run button as shown below. Predator uses jobs to execute the test.

Run Predator Test
Run Predator Test

Configure below job details and then clicking on Submit will trigger the test immediately.

Predator Job
Predator Job

Launch powershell or command prompt and issue docker ps command to see the running containers. Predator will create a container which will execute the tests.

Predator Running Container
Predator Running Container

Viewing Report

During the test run or after its completed, you can view the report in Last Reports page. Click on View button on the appropriate test name as shown below.

Viewing report
Viewing report

Sample report

Predator Report
Predator Report

In next blog we will see more details like architecture, Predator background, advanced features in detail. Please let me know if you have any questions. Happy to help you.

performancetesting Article's
30 articles in total
Favicon
6 Best Practices for Cloud Performance Testing
Favicon
Could the Netflix App Handle Jake Paul vs. Mike Tyson Fight with Load Testing?
Favicon
Best Practices for Mobile App Performance Testing
Favicon
Essential Guide to Android UI Performance Analysis
Favicon
Mastering Audio/Video Testing on Authentic Devices: Ensuring Seamless Performance
Favicon
9 Essential Considerations for Performance testing tools
Favicon
Boosting Telecom Software Quality through Autonomous Testing
Favicon
Network Performance Testing: A Comprehensive Guide
Favicon
A Complete Guide to Mobile App Testing Types
Favicon
Performance Testing Guide - Ensure Your Software Performs at Its Best
Favicon
Load testing 3scale
Favicon
Testing LLMs for Performance with Service Mocking
Favicon
Optimize Performance Testing with PerfDog EVO v10.0: Enhance User Experiences to the Next Level
Favicon
PerfDog EVO v10.0 Introduces Three Major Capability Updates: Deep Analysis, APP Startup Time Analysis, and Network Testing
Favicon
PerfDog EVO v10.0 Breaking Barriers In Game And App Performance Testing
Favicon
Top 11 Performance Testing Tools for 2024
Favicon
PerfDog EVO v10.0: Revolutionizing Games & Apps Performance Testing
Favicon
Exploring Performance Testing: Tools and Applications Guide
Favicon
How Software Performance Testing Can Help Your Business Succeed this Holiday Season
Favicon
List 7 Performance testing tools for web applications
Favicon
How to do performance testing for a web application?
Favicon
My journey with AWS
Favicon
Benefits of using JMeter for Performance Testing
Favicon
Selecting a Load And Performance Testing Framework - Gatling vs. Grafana k6
Favicon
Benefits of using performance testing
Favicon
Performance Testing Report. The importance of Load and Stress Testing your Systems.
Favicon
Top 5 Trends in Mobile Test Automation
Favicon
Why should you invest in performance testing?
Favicon
Getting Started with Predator - ruthless API performance testing
Favicon
Software Performance Testing Complete Guide

Featured ones: