<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gabriel Nascimento on Medium]]></title>
        <description><![CDATA[Stories by Gabriel Nascimento on Medium]]></description>
        <link>https://medium.com/@gabriel.nascimento2048?source=rss-f4eef45d77a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NeRR3zWF_gYDSSwy</url>
            <title>Stories by Gabriel Nascimento on Medium</title>
            <link>https://medium.com/@gabriel.nascimento2048?source=rss-f4eef45d77a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:57:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gabriel.nascimento2048/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[INSIDE OF: Reducing Costs for Performance Tests with Distributed Load Testing on AWS]]></title>
            <link>https://medium.com/@gabriel.nascimento2048/inside-of-reducing-costs-for-performance-tests-with-distributed-load-testing-on-aws-4c34e971a144?source=rss-f4eef45d77a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c34e971a144</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Gabriel Nascimento]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 19:53:52 GMT</pubDate>
            <atom:updated>2026-03-03T19:53:52.230Z</atom:updated>
            <content:encoded><![CDATA[<p>INSIDE OF: Reducing Costs for Performance Tests with Distributed Load Testing on AWS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_U1j85qPy-oOG_WdCA4oLQ.png" /></figure><p>Distributed Load Testing on AWS helps you automate performance testing of your software applications at scale to identify bottlenecks before you release your application. This solution simulates thousands of connected users generating HTTP requests at a sustained rate without the need to provision servers.</p><p>Distributed Load Testing (DLT) can definitely be a <strong>budget-friendly</strong> powerhouse, but whether it’s “cheaper” depends entirely on what you’re comparing it to and how you manage your cloud bill.</p><p>If you’re moving away from traditional, “big-box” enterprise performance testing suites that charge per virtual user (VUser), then <strong>yes</strong>, DLT is usually a massive cost-saver.</p><h3>Why DLT Can Save You Money</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLhYJGT3_HgVuuEvTKZpZw.png" /></figure><h3>No Required Per-User Licensing or Credits</h3><p>Most DLT setups use open-source engines like <strong>JMeter</strong>, <strong>Locust</strong>, or <strong>K6</strong>. Unlike legacy tools, where you pay for the “right” to simulate 10,000 users, DLT costs are tied to the <strong>compute power</strong> you consume, not the number of threads you run.</p><h3>Pay-As-You-Go Infrastructure, pay only when it is used</h3><p>By using cloud providers, you only pay for the duration of the test.</p><ul><li><strong>Spot Instances:</strong> You can run your “worker” nodes on Spot/Preemptible instances for a <strong>70–90% discount</strong> since performance tests are usually ephemeral and can handle a node occasionally dropping out.</li><li><strong>Auto-scaling:</strong> You can spin up 50 servers for a 1-hour stress test and kill them immediately after. Total cost? Usually less than a breakfast at Starbucks.</li></ul><h3>Reduced Hardware Footprint, make it simple</h3><p>Because you are distributing the load, you don’t need a single <strong><em>“monster”</em></strong> machine with 256GB of RAM to run a large test. You can use a fleet of small, cheap containers or VMs, which is often more cost-effective and provides more accurate network latency data.</p><h3>The “Hidden or Secret” Costs to Watch Out For</h3><p>While the software might be <strong>free</strong>, <strong><em>“free” often costs a lot of time</em></strong>.</p><ul><li><strong>Engineering Overhead:</strong> Building a DLT framework from scratch (orchestrating Docker containers, syncing results, managing CI pipelines, building the scripts ) requires high-level DevOps skills. Your <strong>labor cost</strong> might outweigh your tool savings.</li><li><strong>Data Transfer Fees:</strong> If your load generators are in a different region than your application, egress traffic costs can sneak up on you.</li><li><strong>Maintenance:</strong> Open-source tools require manual updates, plugin management, and troubleshooting when the cluster loses synchronization.</li></ul><h3>Set up Process</h3><h3>Implementing Distributed Load Testing (DLT) on AWS with Terraform</h3><p>The first step in building a scalable performance testing environment is deploying the underlying infrastructure. While AWS provides an official <strong>CloudFormation</strong> template for its <a href="https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws/">Distributed Load Testing (DLT) solution</a>, managing this as part of a modern DevOps pipeline is often more effective using <strong>Terraform (.tf ) </strong>as your Infrastructure as Code (IaC) tool.</p><p>Rather than manually translating nearly 8,000 lines of CloudFormation into native Terraform resources, we use a <strong>Terraform wrapper module</strong>. This approach acts as an orchestrator—it deploys the official AWS CloudFormation stack (SO0062, version v4.0.6) while giving you the benefits of Terraform’s state management and modularity.</p><h3>The Architecture</h3><p>The underlying CloudFormation stack provisions a robust, serverless environment designed for high-concurrency testing:</p><h4><strong>Components:</strong></h4><ul><li><strong>Amazon Cognito: </strong>Handles authentication for the DLT web console.</li><li><strong>API Gateway + Lambda: </strong>Powers the backend REST API for test management.</li><li><strong>ECS / AWS Fargate: </strong>Executes the distributed load test tasks (JMeter, K6, or Locust).</li><li><strong>S3 + DynamoDB: </strong>Stores test scenarios, configuration files, and historical results.</li><li><strong>VPC &amp; Networking: </strong>Provides isolation for Fargate tasks with dedicated subnets and security groups.</li></ul><h3>Implementation with Terraform</h3><p>The following module configuration deploys the DLT core. By wrapping the CloudFormation template, you can integrate the solution into your existing Terraform-managed VPC and subnets easily.</p><h4>Usage Example</h4><p>Terraform</p><pre>module &quot;dlt_core&quot; {<br>  source            = &quot;../modules/dlt-core&quot;<br>  admin_name        = &quot;dlt_Admin&quot;<br>  admin_email       = &quot;admin@example.com&quot;<br>  dlt_enable        = true<br>  environment       = var.env<br>  aws_region        = var.region<br>  <br>  # Network Configuration<br>  existing_vpc_id   = module.vpc.vpc_id<br>  existing_subnet_a = module.vpc.private_subnets[0]<br>  existing_subnet_b = module.vpc.private_subnets[1]<br>  egress_cidr       = &quot;0.0.0.0/0&quot;<br>}</pre><ul><li><strong><em>Pro-Tip: Set </em></strong><strong><em>dlt_enable = false to skip the deployment without having to remove the entire module block from your code.</em></strong></li></ul><h3>Project Structure &amp; Files</h3><p>A clean IaC structure is vital for long-term maintenance. The module is organized as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*-yEb6GiAU_L8H1lH0--YZg.png" /></figure><ul><li><strong>main.tf</strong>: Defines the aws_cloudformation_stack resource that consumes the local JSON template.</li><li><strong>variables.tf</strong>: Contains all input definitions, including validation rules for the admin username and email.</li><li><strong>versions.tf</strong>: Terraform and provider version constraints</li><li><strong>distributed-load-testing-on-aws.template</strong>: The official AWS CloudFormation JSON template (~7,900 lines).</li><li><strong>.terraform.lock.hcl</strong>: The dependency lock file. <strong>Always commit this</strong> to ensure reproducible builds across different environments.</li></ul><h3>Key Configuration Variables</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*qDNmJiFaRzhL024rXRkbSA.png" /></figure><p><strong>Important Notes for Deployment</strong></p><ul><li><strong>Capabilities:</strong> The deployment requires CloudFormation CAPABILITY_IAM because the CloudFormation stack creates custom IAM roles and policies for the Lambda and ECS tasks.</li><li><strong>Failure Behavior:</strong> In this module, the on_failure setting is set to &quot;DELETE&quot;. This ensures that if the stack fails to create (e.g., due to a quota limit), it cleans up after itself rather than leaving the environment in a &quot;Rollback Failed&quot; state.</li><li><strong>Reproducibility:</strong> The .terraform.lock.hcl records exact provider versions (e.g., AWS 6.32.1) to guarantee that your production deployment matches your local tests perfectly.</li></ul><h3>Running Tests</h3><p>Should be able to authenticate through the URL created for that service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brUHalWbQl0W4zj43oeoBQ.png" /><figcaption>LOGIN PAGE —</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PFxR5EVWqrOIQbmAjrxzA.png" /><figcaption>HOME PAGE WITH VERSION INFO</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QESr6DJTfItGz9PwZfDGBQ.png" /><figcaption>GENERAL SETTINGS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPj2WXlwfHXshPks9j9t4g.png" /><figcaption>CREATE TEST SCENARIO — SINGLE HTTP REQUEST</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qn4TjlXVRjF30c9nhXhFZQ.png" /><figcaption>CREATE TEST SCENARIO —JMETER UPLOAD ZIP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIbYPKFnPqsGBEaxT3pPKA.png" /><figcaption>TRAFFIC SETUP — TEST DURATION IN MILISECONDS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDazEimXx1v6NmOC2Sm8qQ.png" /><figcaption>REVIEW AND CREATE THE TEST VALIDE THE INFORMATION FOR THE TEST</figcaption></figure><h3>Useful Links</h3><ul><li><a href="https://aws.amazon.com/pt/blogs/architecture/ensure-optimal-application-performance-with-distributed-load-testing-on-aws/">https://aws.amazon.com/pt/blogs/architecture/ensure-optimal-application-performance-with-distributed-load-testing-on-aws/</a></li><li><a href="https://docs.aws.amazon.com/solutions/latest/distributed-load-testing-on-aws/aws-cloudformation-template.html">https://docs.aws.amazon.com/solutions/latest/distributed-load-testing-on-aws/aws-cloudformation-template.html</a></li><li><a href="https://github.com/aws-solutions/distributed-load-testing-on-aws">https://github.com/aws-solutions/distributed-load-testing-on-aws</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c34e971a144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to xk6-browser — Performance Tests for UI]]></title>
            <link>https://medium.com/@gabriel.nascimento2048/introduction-to-performance-test-for-ui-xk6-browser-33d8c0ecbbf7?source=rss-f4eef45d77a------2</link>
            <guid isPermaLink="false">https://medium.com/p/33d8c0ecbbf7</guid>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Gabriel Nascimento]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 20:21:48 GMT</pubDate>
            <atom:updated>2023-07-30T20:23:38.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*-25TVwQ8yhlLCcjT-mXcCQ.png" /></figure><p>This article is related to the previous one and did a comparison with <a href="https://www.linkedin.com/pulse/gatling-vs-k6-how-choose-best-gabriel-nascimento/?published=t">K6 vs Gatling</a>.</p><p>Over the years, k6 has become known as a performance testing tool that provides the best developer experience. Most of our efforts have focused on providing a tool that helps test your servers or backend systems. However, we acknowledge that backend performance testing only addresses half of your performance testing efforts.</p><p>Today will introduce the xk6 browser is an extension of K6. xk6 browser is a browser automation and end-to-end web testing, that allows using all features we have in K6 for our UI application. As well we know backend performance testing is useful and efficient, but it doesn’t represent the overall user experience.</p><p>Based on some <a href="https://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/">studies</a> 80% — 90% of the end-user response time is spent on the frontend part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*pdzs3ktmU0JClFq4Y9CzMQ.png" /><figcaption><a href="https://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/">https://www.stevesouders.com/blog/2012/02/10/the-performance-golden-rule/</a></figcaption></figure><p>The “backend” time is the time it takes the server to get the first byte back to the client. This typically includes the bulk of backend processing: database lookups, remote web service calls, stitching together HTML, etc. The “front end” time is everything else. This includes obvious frontend phases like executing JavaScript and rendering the page. It also includes network time for downloading all the resources referenced on the page. I include this in the frontend time because there’s a great deal web developers can do to reduce this time, such as async script loading, concatenating scripts and stylesheets, and sharding domains.</p><h3>Why xK6-Browser</h3><p>With xk6-browser, you can interact with the browser to script tests much closer to the actual website experience. You’ll get insight into what your user sees on a browser level and catch issues skipped from the protocol level. At the same time, you can adopt a hybrid approach to performance testing by leveraging the existing functionalities of k6 and performing backend load testing on a protocol level, all in the same script. This gives you a full picture of how the user experience is under different load scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*sq8g3lPQAMtyHbMykVaIRA.png" /><figcaption><a href="https://k6.io/docs/javascript-api/xk6-browser/#what-is-xk6-browser">https://k6.io/docs/javascript-api/xk6-browser/#what-is-xk6-browser</a></figcaption></figure><p>It really awesome approach because now we can do test performance on the browser level through this find and solve several issues like:</p><ul><li>When my application is receiving thousands of simultaneous requests from the protocol level, what happens to the front end?</li><li>Are there any loading spinners that take a long time to disappear?</li><li>How the DOM is loaded with many users?</li></ul><p>xk6 is here to answer this and other questions! :)</p><h3>Hands-On</h3><p>First of all the xk6-browser API aims to provide rough compatibility with the <a href="https://playwright.dev/docs/api/class-playwright">Playwright API</a> for NodeJS, meaning k6 users don’t have to learn an entirely new API. At the moment, the k6 API is synchronous. However, since many browser operations happen asynchronously, and in order to follow the Playwright API more closely, we are working on migrating most xk6-browser methods to be asynchronous. This means that while the xk6 browser is ready to be used, be warned that our API is still undergoing a few changes.</p><p>Here is <a href="https://github.com/gabrielnascimento2048/xk6-FE_performance-test">GitHub</a> with some examples and explained all steps that I will describe in this article too.</p><p>After completing the <a href="https://k6.io/docs/javascript-api/xk6-browser/get-started/installation/">installation</a>. (just ensure you have <a href="https://go.dev/doc/install">GO</a>). Let’s start writing and running your test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*3pun5veZksVE6UM92ghoSQ.png" /></figure><p>Ensure import correctly for chromium, launcher is deprecated.</p><p>In this image, we have a simple script that just defines the browser and which type will launch in headless false. In the page have the base URL is a playwright command on the first parameter we have a string the second one is optional we define the options:</p><ul><li>timeout number (optional),</li><li>Maximum operation time in milliseconds, defaults to 30 seconds, pass 0 to disable the timeout. The default value can be changed by using the <a href="https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout">browserContext.setDefaultNavigationTimeout()</a>, <a href="https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout">browserContext.setDefaultTimeout()</a>, <a href="https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout">page.setDefaultNavigationTimeout()</a> or <a href="https://playwright.dev/docs/api/class-page#page-set-default-timeout">page.setDefaultTimeout()</a> methods.</li><li>waitUntil “load”|”domcontentloaded”|”networkidle”|”commit” (optional)</li><li>When considering the operation succeeded, defaults to loading. Events can be either:</li><li>‘domcontentloaded’ — consider an operation to be finished when the DOMContentLoaded event is fired.</li><li>‘load’ — consider an operation to be finished when the load event is fired.</li><li>‘networkidle’ — consider an operation to be finished when there are no network connections for at least 500 ms.</li><li>‘commit’ — consider an operation to be finished when a network response is received and the document started loading.</li></ul><p>On the screenshot part, we just return the buffer with the captured screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*DXIbOP8_CgoPIYddcGNhJA.png" /></figure><p>Then the page.goto() and then() is an alternative to providing rough compatibility with the Playwright API, the xk6-browser API is also being converted from synchronous to asynchronous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*13ksrpjxBzPO8UFXIocEiQ.png" /></figure><p>As explained previously, the k6 API is synchronous. However, since many browser operations happen asynchronously, and in order to follow the Playwright API more closely, is happing migrating most xk6-browser methods to be asynchronous as well.</p><p>The methods as page.goto(), page.waitForNavigation(), and Element.click() return JavaScript promises, and scripts must be written to handle this properly. To avoid timing errors or other race conditions in your script, if you have actions that load up a different page, you need to make sure that you wait for that action to finish before continuing. like the image below on line 14. In the second red board we can see some assertions that are used like for K6 no changes, just be aware to define the correct part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RpNZvnijQNwEMucxXwDhA.png" /></figure><p>The real benefits we can see when the power of K6 is combined with the xk6-browser we can run in the same script in two scenarios. Both scenarios are using the constant-vus executor which introduces a constant number of virtual users to execute as many iterations as possible for a specified amount of time. Since it’s all in one script, this allows for greater collaboration amongst teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMG0kCfpQbfX9826Q6VFnw.png" /></figure><h3>Conclusion</h3><p>With xk6-browser we can really see how our UI application is performing and define some approaches to cover the main issues. But the most important is how it’s easy to set and runs the tests don’t need to learn a new framework or tool because xk6 offers all that things embedded and abstracted to avoid recreating the wheels. Be careful because some features are under development that can be some weird behavior. And we can see how powerful can be xk6 combined with k6 to define custom metrics and use different types of executors and run more than one test in the same script. For more details can check this <a href="https://github.com/gabrielnascimento2048/xk6-FE_performance-test">repo</a> have some nice examples with login pages and assertions all of that is based on K6 and xk6 documentation.</p><p>Thank you very much! and Appreciate what <a href="https://k6.io/docs/javascript-api/xk6-browser/">xk6</a> offers! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33d8c0ecbbf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get better performance Insights by using ElasticSearch and K6 through Docker for Load Testing…]]></title>
            <link>https://medium.com/@gabriel.nascimento2048/get-better-performance-insights-by-using-elasticsearch-and-k6-through-docker-for-load-testing-ff5b0324433a?source=rss-f4eef45d77a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff5b0324433a</guid>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Gabriel Nascimento]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 19:06:02 GMT</pubDate>
            <atom:updated>2023-07-27T19:25:05.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*8bs1CvgzjQ4GeQC8EsJafg.png" /></figure><p><strong>Get better performance Insights by using ElasticSearch and K6 through Docker for Load Testing Analysis with xk6-output-elasticsearch</strong></p><p>Using Kibana with K6 can be a powerful combination for monitoring and analyzing the results of load and performance tests performed with K6. This combination allows visualization of the results in a centralized environment.</p><p><strong>Why use Elasticsearch?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Scwb7L27DziQNRT35N1VJw.png" /></figure><p>ElasticSearch is a mechanism to search and data analysis with the main features:</p><p><strong>Efficient Search</strong>: Elasticsearch provides full-text and real-time searches on a large number of documents, allowing users to obtain relevant results quickly.</p><p><strong>Scalability</strong>: It is possible to add new nodes to the Elasticsearch cluster to handle data and traffic growth, ensuring high availability and performance.</p><p><strong>Flexible Indexing</strong>: Data is stored in JSON format and automatically indexed, making it easier to search and retrieve information.</p><p><strong>Data Analysis</strong>: Elasticsearch supports aggregations and metrics to perform analyses on stored data, enabling significant insights from indexed data.</p><p><strong>Geospatial Search</strong>: It offers support for geospatial queries, allowing location-related data to be efficiently searched.</p><p><strong>Integration with other systems</strong>: Elasticsearch can be easily integrated with various popular tools and libraries for data analysis and visualization, such as Kibana (for visualization) and Logstash (for log data processing).</p><p><strong>Why use Kibana?</strong></p><p>Using Kibana together with Elasticsearch brings several advantages for data analysis and visualization. Kibana is a user-friendly and interactive interface designed to work seamlessly with Elasticsearch, complementing its functionalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cieuk2DfcFEpAa0sf0NmDA.png" /></figure><p>Here are some reasons why using Kibana with Elasticsearch is beneficial:</p><p><strong>Data Visualization</strong>: Kibana allows you to create interactive panels and charts from the data indexed in Elasticsearch. It offers a variety of visualization options, such as bar charts, pie charts, geographic maps, and more. These visualizations make it easy to understand data and identify trends and patterns.</p><p><strong>Real-Time Data Analysis:</strong> Since Elasticsearch provides real-time searches, Kibana can display and update data visualizations instantly as new data is indexed. This enables continuous real-time analysis and monitoring of systems, logs, and metrics.</p><p><strong>Custom Dashboards:</strong> With Kibana, users can create custom dashboards based on their specific needs. This makes data analysis highly customizable and adaptable to different use cases.</p><p><strong>Integration with Dashboards:</strong> Kibana makes it easy to create comprehensive dashboards that aggregate multiple visualizations and panels into a single screen. These dashboards help consolidate important information and provide an overview of data in one place.</p><p><strong>Easy Data Exploration:</strong> Kibana allows users to search and filter data intuitively and efficiently. Users can use search queries and filters to obtain specific information quickly and accurately.</p><p><strong>Geolocation Support:</strong> Kibana has built-in features for geospatial data visualization. This is especially useful when working with location-related data, such as vehicle tracking, point-of-sale analysis, and more.</p><p><strong>Alerts and Notifications:</strong> Kibana offers features to set up alerts based on specific conditions in the data. This allows users to be automatically notified when important events or situations occur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*fxDrmNdTpNovGkRw0wXgCw.png" /></figure><p><strong>Why use xk6-output-elasticsearch?</strong></p><p>This is an <a href="https://k6.io/docs/extensions/get-started/explore/">extension </a>provided by K6 to integrate Elasticsearch and Kibana in your performance test to export results in the easiest way.</p><p>After this small introduction showed the benefits and why we should use it now let&#39;s have a hands-on step-by-step to understand how we can integrate and create a powerful combination with data analysis and visualization.</p><p><strong>Hands-on</strong></p><p>We have many different ways to integrate and export results, here will show two possibilities.</p><p><strong>Possibility One</strong></p><p>Clone this repo <a href="https://github.com/elastic/xk6-output-elasticsearch">xk6-output-elasticsearch</a></p><p>The approach used for this tutorial is via docker</p><ul><li>Start the docker-compose environment.</li></ul><pre>docker-compose up -d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*OM_u_LwR7dpiVt72vsj78A.png" /><figcaption>After starting the container</figcaption></figure><p>Just ensure that the container is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tmjSful0xUiytixYWJCPEw.png" /></figure><ul><li>Use the k6 Docker image to run the k6 script and send metrics to the Elasticsearch cluster started.</li></ul><p>For Windows:</p><pre>docker-compose run --rm -v ${PWD}:/inside/docker/path -T k6 run /inside/docker/path/examples/script.js --tag testid=test-1</pre><p>For Mac and Linux:</p><pre>docker-compose run --rm -T k6 run -&lt;examples/script.js --tag testid=test-1</pre><p>K6 script execution for Windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTRNsoXNAa5zPl5ZeOxtsg.png" /><figcaption>script execution</figcaption></figure><ul><li>Visit <a href="http://localhost:5601/">http://localhost:5601/</a> to view results in Kibana (default credentials are elastic / changeme).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*ArbrsX6tneHt8wPqinEMxA.png" /><figcaption>Username: elastic / Password: changeme</figcaption></figure><ul><li>Create a Data View for the index K6-metrics. it means Kibana requires a data view to access the Elasticsearch data that you want to explore.</li></ul><blockquote>Stack Management</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3_evYUMA3CBfp3oZksN1Q.png" /></figure><blockquote>Data Views</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkI3unoqCddi-GMCQmvNmA.png" /></figure><blockquote>Create data view with name “k6-metrics”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VoohRaQa7CWvXYPAFfB6cg.png" /></figure><blockquote>Go to Discover then can see the dashboard</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLkfWZ31dXEdfo0CIXLlEw.png" /></figure><blockquote>And also can select specific time execution and set some metrics.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kbh90JdHL-dhFMmKNpotg.png" /></figure><blockquote>to clean up run docker-compose down -v</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*sY7r1wXhR5qzZGkrz3ab9w.png" /></figure><p><strong>Possibility Two</strong></p><p>This way we just added the Dockerfile to run the latest K6 version and also used the extension xk6-output-elasticsearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mKCzwYYuBgLTJeXffRkMw.png" /></figure><p>The docker-compose.yml, and .env file.</p><p>Like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*S4uUbw6QaDTcC7OFrZYoUw.png" /></figure><p>With this approach, you can add those files to your project and then use the full power of elasticsearch and Kibana.</p><p>The further steps are the same as the possibility one.</p><ul><li>docker-compose up -v</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*4Wj1YaWszzjiyIfNQoJrCQ.png" /></figure><ul><li>docker-compose run — rm -v ${PWD}:/inside/docker/path -T k6 run /inside/docker/path/examples/script.js — tag testid=test-1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXyZ84FiGzUtc708x-BWoA.png" /></figure><ul><li><a href="http://localhost:5601/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-15m,to:now))&amp;_a=(columns:!(),filters:!(),index:a4e58113-6a1c-4d0d-8144-bde9fcc83f83,interval:auto,query:(language:kuery,query:&#39;&#39;),sort:!(!(Time,desc)))">discover </a>the dashboard</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Lgy-1n2LW7qslZ31JG2LQ.png" /></figure><p>can check this repo as template <a href="https://github.com/gabrielnascimento2048/kibana_k6/tree/main/examples">k6 with elastic</a>.</p><p><strong>Conclusion</strong></p><p>The combination of Elasticsearch with Kibana (and often also with Logstash as part of the ELK stack) creates a powerful data analysis and visualization platform widely used for system monitoring, log analysis, metric tracking, data exploration, and gaining valuable insights in real time. With xk6-output-elasticsearch can easily set your project to export results via the docker. Can also change the type of charts and added more metrics following what you need.</p><p>I hope enjoy it! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff5b0324433a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring K6 with Grafana dashboard and docker]]></title>
            <link>https://medium.com/@gabriel.nascimento2048/hello-everyone-3ad9224cd214?source=rss-f4eef45d77a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ad9224cd214</guid>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Gabriel Nascimento]]></dc:creator>
            <pubDate>Thu, 20 Jul 2023 00:58:16 GMT</pubDate>
            <atom:updated>2023-07-20T01:07:04.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMfuJX-riaOw15hHIFPEVg.jpeg" /></figure><p>Hello everyone! today let’s understand step by step how to use K6 with docker, set the database, and define a dashboard for monitoring tools.</p><p>The goal of this article is to explain how is essential and easy to integrate databases like influxDb, and monitoring tools like Grafana to create a visual dashboard for managing and monitoring applications.</p><p>The most important part to have monitoring tools is to track some degradation environments and analyze how the application performs through increasing features and updates. Because with performance tests we can collect several metrics and define thresholds, nothing matter if we don&#39;t have this information properly organized to verify the values, due to that is always important to have monitoring tools.</p><p>First of all, ensure that you have a <a href="https://www.docker.com/products/docker-desktop/">docker</a> desktop installed on your machine.</p><p>We will use this <a href="https://github.com/luketn/docker-k6-grafana-influxdb/tree/master">repo</a> as a base. After to verify have docker desktop is installed correctly.</p><p>run the command</p><blockquote>docker-compose up</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t72q5MhlZ2klCJJU0OzHug.png" /></figure><p>This command will launch container instance for InfluxDb, K6 and grafana. We can see the full file <a href="https://github.com/gabrielnascimento2048/docker_K6/blob/main/docker-compose.yml">here</a> the docker-compose.yml, just ensure if don&#39;t use the same port for more than one application.</p><p>We should see on docker desktop this status of the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jqntSGXmgT00uiyI0YjgLA.png" /></figure><p>To see the dashboard on the screen we should provide where we could get the information, due to this we have the datasource. yml, this file can be used to automate the configuration process of Grafana and ensure that the necessary data sources are available after the installation or deployment of the system. It is particularly useful in environments where multiple instances of Grafana are being deployed, and the configuration needs to be standardized across all of them. It’s essential to mention that the name and format of the configuration file may vary depending on the specific implementation of Grafana or the management tool used for provisioning the infrastructure. In some setups, the file may be named `datasources.yml` or `datasources.json`. The documentation of the tool or infrastructure provider being used typically provides specific details on how to create this configuration file correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*K1AZCXuUodom5W5lJMNmPQ.png" /></figure><p>We need to configure the grafana-dashborad.json this file is where we custom our dashboard following json structure, adding metrics and threshold that we would like to see on the dashboard, here example <a href="https://github.com/gabrielnascimento2048/docker_K6/blob/main/dashboards/k6-load-testing-results_rev3.json">file</a>. After custom your dashboard just to access this URL:</p><blockquote><a href="http://localhost:3000/?orgId=1">http://localhost:3000</a></blockquote><p>can see this main screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gO68moogezsmjAM7lykOGQ.png" /></figure><p>The dashboard with metrics added</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LhVF3u4m5PpbNLLpVNo0vA.png" /></figure><p>With those steps you could be able to run your performance script to collect and see the metrics provided by the dashboard.</p><p>For small test can run this <a href="https://github.com/gabrielnascimento2048/docker_K6/blob/main/scripts/load.js">load script</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*qCrbcE1qLfvqbeRiB6o_Bg.png" /></figure><p>To run the script just</p><blockquote>docker-compose run k6 run /yourPath/load.js</blockquote><p>Then can see on the logs the call starting and also after completed the execution the thresholds and metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51uE5bZmxpZJJ-3bh1Onfg.png" /></figure><blockquote>After run the script you can be able to see the dashboard seems this</blockquote><blockquote><a href="http://localhost:3000/d/k6/k6-load-testing-results?orgId=1&amp;refresh=5s">http://localhost:3000/d/k6/k6-load-testing-results?orgId=1&amp;refresh=5s</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QyJV_QEB5JzMI-UjoQGgQ.png" /></figure><p>On this example is possible to see the load test technique be applied where the graph start to increase ramp-up then keep the user for some time then start ramp-down.</p><p>Here can see the all techniques applied base on the graphs should be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5W36GO_sxmOebB_Gh2He8w.png" /></figure><p>Base on this approach can also added some warning when some thresholds are achieved, or send the data for azure DevOps through the workbooks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*87DGqAG4ZuqOAU3gfAPyHA.png" /></figure><p>I hope you enjoy this article and see you soon. :)</p><p>The main repo base this one <a href="https://github.com/luketn/docker-k6-grafana-influxdb">https://github.com/luketn/docker-k6-grafana-influxdb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ad9224cd214" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>