{"id":68009,"date":"2022-10-20T09:01:12","date_gmt":"2022-10-20T09:01:12","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=68009"},"modified":"2022-10-20T09:01:12","modified_gmt":"2022-10-20T09:01:12","slug":"test-your-iot-platform-with-open-source-tools","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=68009","title":{"rendered":"Test your IoT platform with open source tools"},"content":{"rendered":"<p><span class=\"field field--name-title field--type-string field--label-hidden\">Test your IoT platform with open source tools<\/span><br \/>\n<span class=\"field field--name-uid field--type-entity-reference field--label-hidden\"><a title=\"View user profile.\" href=\"https:\/\/opensource.com\/users\/chongyuanyin\" class=\"username\">Chongyuan Yin<\/a><\/span><br \/>\n<span class=\"field field--name-created field--type-created field--label-hidden\">Thu, 10\/20\/2022 &#8211; 03:00<\/span><\/p>\n<div class=\"clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item\">\n<p>The Internet of Things (IoT) and <a href=\"https:\/\/www.redhat.com\/en\/topics\/edge-computing\/what-is-edge-computing?intcmp=7013a000002qLH8AAM\" target=\"_blank\" rel=\"noopener\">edge computing<\/a> 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&#8217;re delivering services, then testing your IoT system can help you find bottlenecks in performance, and help you plan ahead for scalability.<\/p>\n<p>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 <a href=\"https:\/\/github.com\/emqx\/emqx\">EMQX<\/a> as an example of how to introduce performance test tools to verify and test platform-related quality indicators.<\/p>\n<\/p>\n<div class=\"embedded-resource-list callout-float-right\">\n<div class=\"field field--name-title field--type-string field--label-hidden field__item\">More on edge computing<\/div>\n<div class=\"field field--name-links field--type-link field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/topics\/edge-computing?intcmp=7016000000127cYAAQ\">Understanding edge computing<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/article\/21\/2\/linux-edge-computing?intcmp=7016000000127cYAAQ\">Why Linux is critical to edge computing<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/kubernetes-raspberry-pi?intcmp=7016000000127cYAAQ\">eBook: Running Kubernetes on your Raspberry Pi<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/engage\/automated-enterprise-ebook-20171115?intcmp=701f2000000h4RcAAI\">Download now: The automated enterprise eBook<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/downloads\/home-automation-ebook?intcmp=701f2000000h4RcAAI\">eBook: A practical guide to home automation using open source tools<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/www.redhat.com\/en\/engage\/automation-at-edge-20220727?intcmp=701f2000000h4RcAAI\">eBook: 7 examples of automation on the edge<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/edge-computing?intcmp=701f2000000h4RcAAI\">The latest on edge<\/a><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<h2>EMQX<\/h2>\n<p>EMQX is a scalable messaging (MQTT) broker used to connect IoT devices. It&#8217;s open source, but because it&#8217;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 <a href=\"https:\/\/www.emqx.io\/docs\/en\/v5.0\/deploy\/install.html\">install and run EMQX on your own server<\/a>.<\/p>\n<h2>Introduction to JMeter<\/h2>\n<p>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:<\/p>\n<ul>\n<li>Built-in support for multiple protocols, including TCP, HTTP, HTTPS, and more.<\/li>\n<li>Provides a flexible plug-in extension mechanism and supports third-party extensions of other protocols.<\/li>\n<li>Great community support.<\/li>\n<\/ul>\n<h2>Install JMeter<\/h2>\n<p>JMeter is written in Java, so you must install Java if it&#8217;s not already installed. For Linux, macOS, and Windows, you can use <a href=\"https:\/\/adoptium.net\/\">Adoptium.net<\/a>. On Linux, you may alternatively use <a href=\"https:\/\/opensource.com\/article\/22\/3\/manage-java-versions-sdkman\">SDKMan<\/a>.<\/p>\n<p>After installing Java, download <a href=\"https:\/\/jmeter.apache.org\/download_jmeter.cgi\">JMeter<\/a>, decompress it, and enter the <code>bin<\/code> subdirectory of the archive directory. Depending on your operating system, run <code>jmeter<\/code> (Linux and macOS) or <code>jmeter.bat<\/code> (Windows).<\/p>\n<pre>\n<code>$ wget https:\/\/dlcdn.apache.org\/\/jmeter\/binaries\/apache-jmeter-X.Y.tgz\n$ tar xvf apache-jmeter*tgz\n$ cd apache-jmeter-X.Y\/bin\n$ .\/jmeter<\/code><\/pre>\n<p>JMeter&#8217;s script editing interface is presented to you:<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-interface.png\" width=\"1538\" height=\"866\" alt=\"Image of Apache jmeter interface.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<h2>Your first JMeter test<\/h2>\n<p>Here&#8217;s how to use JMeter to build and run a simple HTTP test case.<\/p>\n<ol type=\"1\">\n<li>\n<p>JMeter uses a single thread to simulate a user. A <strong>Thread Group<\/strong> refers to a virtual user group, and simulates access to the system being tested.<\/p>\n<p>To add a virtual user group (Thread Group), right-click on <strong>Test plan<\/strong> &gt; <strong>Add<\/strong> &gt; <strong>Threads (Users)<\/strong> &gt; <strong>Thread Group<\/strong>.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-thread-group-add.png\" width=\"701\" height=\"308\" alt=\"Image of adding a thread group to Apache.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<p><strong>Number of Threads<\/strong> in <strong>Thread Properties<\/strong> 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 <strong>Loop Count<\/strong> to configure how many tests each virtual user performs.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-thread-properties.png\" width=\"613\" height=\"213\" alt=\"Image of Apache thread properties.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<\/li>\n<li>\n<p>JMeter includes several example tests. Add the <strong>HTTP Request<\/strong> test with a right-click on <strong>Thread Group<\/strong> &gt; <strong>Add<\/strong> &gt; <strong>Sampler<\/strong> &gt; <strong>HTTP Request<\/strong>.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-http-request-add.png\" width=\"695\" height=\"328\" alt=\"Image of Apache request add.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<p>In the sample test script, use the default HTTP request settings to initiate an HTTP request to a website.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/ranger-filemanager.png\" width=\"739\" height=\"300\" alt=\"Set an HTTP request in JMeter.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<\/li>\n<li>\n<p>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 <strong>View Result Tree<\/strong> to help view the response information of the request.<\/p>\n<p>To add a result listener, right-click on <strong>Thread group<\/strong> &gt; <strong>Add<\/strong> &gt; <strong>Listener<\/strong> &gt; <strong>View Results Tree<\/strong>.<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-view-results-tree-add.png\" width=\"814\" height=\"372\" alt=\"Image of Apache view results tree.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<\/li>\n<li>\n<p>Time to run the test. After saving your test script, click the <strong>Start<\/strong> button in the top toolbar to run the test script. Because you&#8217;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!<\/p>\n<article class=\"align-center media media--type-image media--view-mode-default\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/apache-jmeter-test-results.png\" width=\"731\" height=\"537\" alt=\"Image of Apache test results.\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>(Chongyuan Yin, CC BY-SA 4.0)<\/p>\n<\/div>\n<\/article>\n<\/li>\n<\/ol>\n<h2>Test your IoT platform<\/h2>\n<p>You&#8217;ve completed a simple HTTP test script. You can draw inferences from this case and try other protocols. In the next article, I&#8217;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.<\/p>\n<\/div>\n<div class=\"clearfix text-formatted field field--name-field-article-subhead field--type-text-long field--label-hidden field__item\">\n<p>This demo of JMeter using EMQX shows how to introduce performance test tools to verify and test platform-related quality indicators.<\/p>\n<\/div>\n<div class=\"field field--name-field-lead-image field--type-entity-reference field--label-hidden field__item\">\n<article class=\"media media--type-image media--view-mode-caption\">\n<div class=\"field field--name-field-media-image field--type-image field--label-hidden field__item\">  <img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png\" width=\"520\" height=\"292\" alt=\"Looking at a map\" title=\"Looking at a map\"><\/div>\n<div class=\"field field--name-field-caption field--type-text-long field--label-hidden caption field__item\"><span class=\"caption__byline\">Image by: <\/span><\/p>\n<p>opensource.com<\/p>\n<\/div>\n<\/article>\n<\/div>\n<div class=\"field field--name-field-tags field--type-entity-reference field--label-hidden field__items\">\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/edge-computing\" hreflang=\"en\">Edge computing<\/a><\/div>\n<div class=\"field__item\"><a href=\"https:\/\/opensource.com\/tags\/internet-things-iot\" hreflang=\"en\">Internet of Things (IoT)<\/a><\/div>\n<\/p><\/div>\n<div class=\"hidden field field--name-field-listicle-title field--type-string field--label-hidden field__item\">What to read next<\/div>\n<div class=\"field field--name-field-default-license field--type-list-string field--label-hidden field__item\"><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><br \/>\n        <img decoding=\"async\" alt=\"Creative Commons License\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2022\/10\/cc-by-sa--20.png\" title=\"This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.\"><\/a>This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.<\/div>\n<section class=\"field field--name-field-comments field--type-comment field--label-hidden comment-wrapper\">\n<div class=\"comments__count\">\n<div class=\"login\"><a href=\"https:\/\/opensource.com\/user\/register?absolute=1\">Register<\/a> or <a href=\"https:\/\/opensource.com\/user\/login?current=\/rss.xml&amp;absolute=1\">Login<\/a> to post a comment.<\/div>\n<\/p><\/div>\n<\/section>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Test your IoT platform with open source tools Chongyuan Yin Thu, 10\/20\/2022 &#8211; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":68010,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-68009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/68009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68009"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/68009\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/68010"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}