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
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

Elevate your data management. Join a lively chat to learn how streaming data can improve real-time decision-making, and how to reduce costs.

Platform Engineering: Enhance the developer experience, establish secure environments, automate self-service tools, and streamline workflows

Build Cloud resilience. High-profiled cloud failures have shown us one thing – traditional approaches aren't enough. Join the discussion.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Related

  • Dust: Open-Source Actors for Java
  • Using SQS With JMS for Legacy Applications
  • How To Compare DOCX Documents in Java
  • Hibernate Validator vs Regex vs Manual Validation: Which One Is Faster?

Trending

  • Apache Iceberg: The Open Table Format for Lakehouses and Data Streaming
  • “Let’s Cook!”: A Beginner's Guide to Making Tasty Web Projects
  • Navigating API Challenges in Kubernetes
  • AI-Driven Intent-Based Networking: The Future of Network Management Using AI
  1. DZone
  2. Data Engineering
  3. IoT
  4. Test an IoT Platform With Open-Source Tools

Test an IoT Platform With Open-Source Tools

This demo of JMeter using EMQX shows how to introduce performance test tools to verify and test platform-related quality indicators.

By 
Chongyuan Yin user avatar
Chongyuan Yin
·
Dec. 09, 22 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
4.7K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

The IoT industry is developing explosively. As the scale of endpoints continues to grow and business logic becomes more complex, it is necessary to verify the availability and reliability of the platform when a large number of devices are connected before the IoT platform is officially launched so as to ensure system quality. Therefore, the value and necessity of IoT performance tests are gradually highlighted. If you're delivering services, then testing your IoT system can help you find bottlenecks in performance and help you plan ahead for scalability.

IoT can consist of any number of different devices using diverse protocols strung together with complex integration architecture. This can make it challenging to design effective and meaningful tests for it. This series of articles will take the IoT platform based on EMQX as an example to introduce how to use performance test tools to verify and test platform-related quality indicators.

EMQX is a scalable messaging (MQTT) broker used to connect IoT devices. It's open source, but because it's a broker, you must have a working node to manage all the messaging traffic. You can accept its business source license (BSL) and gain 10 licenses to use the official EMQX cloud installation. Alternatively, you can install and run EMQX on your own server.

Introduction to JMeter

JMeter is an open-source software of the Apache Foundation. It mainly implements performance tests by simulating concurrent loads, which is currently the mainstream performance test tool in the open-source community. It mainly has the following advantages:

  • Built-in support for multiple protocols, including TCP, HTTP, HTTPS, and more.
  • Provides a flexible plug-in extension mechanism and supports third-party extensions of other protocols.
  • Great community support.

Install JMeter

JMeter is written in Java, so you must install Java if it's not already installed. For Linux, macOS, and Windows, you can use Adoptium.net. On Linux, you may alternatively use SDKMan.

After installing Java, download JMeter, decompress it, and enter the bin subdirectory of the archive directory. Depending on your operating system, run jmeter (Linux and macOS) or jmeter.bat (Windows).

$ wget https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-X.Y.tgz
$ tar xvf apache-jmeter*tgz
$ cd apache-jmeter-X.Y/bin
$ ./jmeter


JMeter's script editing interface is presented here:

JMeter


Next, let's take HTTP as an example to see how to use JMeter to build and run a simple test case.

1. Add a virtual user group (Thread Group): Right-click on the test plan > Add > Threads (Users) > Thread Group

JMeter Add Thread Group


JMeter uses a single thread to simulate a user, and a Thread Group refers to a group of users as a virtual user group simulating access to the system under test.

「Number of Threads」 in 「Thread Properties」 can be used to configure the number of concurrent users in a virtual user group. The higher the value, the greater the amount of concurrency; 「Loop Count」 can be used to configure how many tests each virtual user performs.

JMeter Thread Properties


2. Add the HTTP page under test: Right-click on the Thread Group > Add > Sampler > HTTP Request

JMeter Add the HTTP page


In the sample test script, use the default HTTP request settings to initiate an HTTP request to a website.

JMeter HTTP request


3. Add a result listener: Right-click on the thread group > Add > Listener > View Results Tree

The listener is not necessary for the actual performance test, but it can help you see the test results intuitively and facilitate debugging in the process of writing scripts. In this sample script, we will use 「view result tree」 to help view the response information of the request.

JMeter Add a result listener


4. Time to run the test

After saving the test script, click「Start」button in the operation bar to run the test script. It is recommended that the number of threads and the loop count in the thread group be set smaller (such as within 10) to avoid being banned.

Now, we have completed a simple HTTP test script. You can draw inferences from this case and try other protocols. In the next article, I'll introduce other test components of JMeter in more detail, which you can use together to build complex test scenarios. For now, explore JMeter to see what you can test.

Open source Apache JMeter Java (programming language) MQTT

Published at DZone with permission of Chongyuan Yin. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Dust: Open-Source Actors for Java
  • Using SQS With JMS for Legacy Applications
  • How To Compare DOCX Documents in Java
  • Hibernate Validator vs Regex vs Manual Validation: Which One Is Faster?

Partner Resources


Comments

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: