Open-source News

Test your IoT platform with open source tools

opensource.com - Thu, 10/20/2022 - 15:00
Test your IoT platform with open source tools Chongyuan Yin Thu, 10/20/2022 - 03:00

The Internet of Things (IoT) and edge computing industries are developing quickly, and with it so does the scale of endpoints and the complexity of business logic. The more the IoT ecosystem grows, the more important it becomes to verify the availability and reliability of your platform. 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. In this article, I demonstrate how to test an IoT platform using EMQX as an example of how to introduce performance test tools to verify and test platform-related quality indicators.

More on edge computing Understanding edge computing Why Linux is critical to edge computing eBook: Running Kubernetes on your Raspberry Pi Download now: The automated enterprise eBook eBook: A practical guide to home automation using open source tools eBook: 7 examples of automation on the edge The latest on edge EMQX

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. Alternately, 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, a common performance testing method 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 to you:

Image by:

(Chongyuan Yin, CC BY-SA 4.0)

Your first JMeter test

Here's how to use JMeter to build and run a simple HTTP test case.

  1. JMeter uses a single thread to simulate a user. A Thread Group refers to a virtual user group, and simulates access to the system being tested.

    To add a virtual user group (Thread Group), right-click on Test plan > Add > Threads (Users) > Thread Group.

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

    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. Use Loop Count to configure how many tests each virtual user performs.

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

  2. JMeter includes several example tests. Add the HTTP Request test with a right-click on Thread Group > Add > Sampler > HTTP Request.

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

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

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

  3. A result listener is not strictly necessary for the performance test, but it lets you see the test result. This can help facilitate debugging in the process of writing scripts. In this sample script, use View Result Tree to help view the response information of the request.

    To add a result listener, right-click on Thread group > Add > Listener > View Results Tree.

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

  4. Time to run the test. After saving your test script, click the Start button in the top toolbar to run the test script. Because you're testing against a public website, use a low number (under 10) of threads and loop count. If you spam the site, you could find yourself blocked in the future!

    Image by:

    (Chongyuan Yin, CC BY-SA 4.0)

Test your IoT platform

You've 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.

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

Image by:

opensource.com

Edge computing Internet of Things (IoT) What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Corsair PSU Linux Driver Patched To Work With The New HX1500i PSU

Phoronix - Thu, 10/20/2022 - 07:47
Corsair this summer launched the HX1500i power supply as the latest in their HX series. The Corsair HX1500i provides three EPS12V connectors, a fully modular design, and as implied by the model is sized for providing 1500 Watts. This $399 USD power supply can now also interface with the Linux kernel for monitoring support...

Call Depth Tracking Aligning For Linux 6.2 To Lessen Mitigation Performance Hit For Intel Skylake

Phoronix - Thu, 10/20/2022 - 01:00
While the Linux 6.1 merge window just passed and the "Call Depth Tracking" patches have been in development the past few months, it looks like that for the Linux 6.2 kernel is where that alternative mitigation technique will be introduced for helping offset some of the significant performance regressions incurred for Intel Skylake era processors as a result of recent CPU security vulnerability mitigations...

systemd 252-rc2 Released With More Changes To This Key Linux Component

Phoronix - Wed, 10/19/2022 - 23:48
Two weeks ago was the release of systemd 252-rc1 with introducing the new systemd-measure command, a "support-ended" taint flag for OS images detected past their end-of-support date, and a wide variety of other changes and feature additions. Systemd 252-rc2 is now available for additional testing with various fixes plus a few more additions...

Pages