<?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 Suneeth Lenin on Medium]]></title>
        <description><![CDATA[Stories by Suneeth Lenin on Medium]]></description>
        <link>https://medium.com/@suneethlenin?source=rss-43e2fc1d73c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3Jjnf8RyZwcfq3xtyEB5ug@2x.jpeg</url>
            <title>Stories by Suneeth Lenin on Medium</title>
            <link>https://medium.com/@suneethlenin?source=rss-43e2fc1d73c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 03:29:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suneethlenin/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[How to Load Test Your GraphQL API Using GitHub Actions and Artillery]]></title>
            <link>https://blog.stackademic.com/how-to-load-test-your-graphql-api-using-github-actions-and-artillery-788013c12dae?source=rss-43e2fc1d73c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/788013c12dae</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[artillery]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[performance-testing]]></category>
            <dc:creator><![CDATA[Suneeth Lenin]]></dc:creator>
            <pubDate>Fri, 01 Dec 2023 11:49:12 GMT</pubDate>
            <atom:updated>2023-12-18T01:46:54.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ucBShk1IuowpxggV" /><figcaption>Photo by <a href="https://unsplash.com/@victorfreitas?utm_source=medium&amp;utm_medium=referral">Victor Freitas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Load testing or performance testing is often an overlooked part of API development. We, I mean developers, tend to create/modify APIs for a living but often don’t pay much attention to testing them for performance changes. The move to cloud services for running your servers ( or no server at all using serverless) led the performance tests to take a back seat. Auto scaling your application as needed is now a basic feature of any cloud provider and hence the performance is more than often taken for granted until an incident occurs 😀.</p><p>A similar incident happened to me recently. One of our developers reported that when he analyzed the Datadog dashboard for one of our services he could see an increasing memory graph till the service restarts indicating a potential memory leak. The problem didn’t seem drastic as there is no <a href="https://neo4j.com/developer/kb/linux-out-of-memory-killer/">OOMKilled</a> event in the logs, but I took this opportunity to do a small load test on our service to see how it performs and if there is a memory leak in the process.</p><p>I selected Artillery as the load-testing library because</p><ul><li>It&#39;s popular and offers a lot of flexibility.</li><li>It is already being used in my company.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcMJsqeSvw4nTx7YXRg%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fcbc-david-schittscreek-313-cMJsqeSvw4nTx7YXRg&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExOHI2Mml2anB4MTJxcHNmM2JlYTA2dzNmdWxiMDhqMng5a2V0dmZnaCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FcMJsqeSvw4nTx7YXRg%2Fgiphy-downsized-large.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b7c389c32c327543abcd8cd836cc573/href">https://medium.com/media/4b7c389c32c327543abcd8cd836cc573/href</a></iframe><h4>Configuring artillery for load tests</h4><p>I have started with this <a href="https://www.artillery.io/blog/using-artillery-to-load-test-graphql-apis">Artillery official blog article</a>. It is a good article that explains the basics of how to do the testing using Artilliery’s HTTP engine. But writing GraphQL queries within the artillery config file was a major pain point because</p><ol><li>No syntax highlight and no code formatting.</li><li>Fragments cannot be written which can be used in multiple queries.</li></ol><p>After combing through <a href="https://www.artillery.io/docs/reference/engines/http#writing-custom-logic-in-javascript">artillery docs</a> and with some trials and errors I came up with the below configuration which works flawlessly for my use case.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6979b95f63b16006e3a2c51fc9611691/href">https://medium.com/media/6979b95f63b16006e3a2c51fc9611691/href</a></iframe><p>The yaml configuration is well explained in the<a href="https://www.artillery.io/docs/get-started/first-test"> official docs of artillery</a> so I will not go into detail about each config but will explain those relevant to this article.</p><p>I have used three <a href="https://www.artillery.io/docs/reference/test-script#phases---load-phases">load phases</a> for the test- <em>startup</em>, <em>peak</em>, and <em>slow down</em>. As shown above, variables are used instead of actual values to set phase duration, arrival rate, etc. This allows us to pass different values when we run the test from a CLI or CI/CD environment of choice.</p><blockquote><strong>Note:</strong><br><strong>$processEnvironment</strong> is now replaced by <strong>$env</strong> in newer versions of artilliery. But during the time of writing it is not available in the <a href="https://github.com/artilleryio/action-cli">official github action</a> provided by artilliery team.</blockquote><p><strong>Processor</strong></p><p>The processor option helped in moving the GraphQL query and mutations out of the configuration file. processor option let us assign a javascript module that exports a set of functions that can be run before or after a request is executed. Please see processoroption and the use of beforeRequest option with a value of setConfigCreateBodyunder the first request in flow . Artillery will expect the processor.cjs file to have an exported function named setConfigCreateBody and will run that function before it executes the request. This lets us</p><ul><li>Add/remove headers from the request.</li><li>Customize the body of the request. Here we added the GraphQL query and variables to the request.</li></ul><p>Here is an example processor.cjs file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f82d54cf531c94e21fdcf84cdd681de/href">https://medium.com/media/4f82d54cf531c94e21fdcf84cdd681de/href</a></iframe><p><strong>Capture</strong></p><p>I’m creating a MongoDB objectId randomly to create record and I need the contentId in subsequent requests to update and delete the record created in the first step. capture option allows us to do exactly the same. The response data captured via this option will be available in our processor.cjs module under thecontext.vars object. Please see how it is used in setConfigUpdateBody function above.</p><p><strong>Expect</strong></p><p>The next step is to ensure that no errors are coming in the response. Since GraphQL responses always send 200 status code for both error and success our only option is to check the presence of errors object in the response. Artillery has a built-in plugin called expect, which needs to be enabled before use. Using expect and notHasProperty as shown in the artillery config file, we were able to check if the request was a failure or not.</p><p>With this configuration, we are now ready for load testing. We can do the testing using artillery CLI by providing the required environment variables for the duration, arrival rate, etc. But that is tedious and you need to have access to the configuration file, artillery npm module, etc in your local machine for the test to run. Moreover, you need to know exactly the command to run the tests. It makes sense for a developer but if a non-developer from your team needs to run a load test, they are in for a lot of pain. Thankfully artillery provides pre-built integration with a number of CI/CD tools, <a href="https://www.artillery.io/docs/cicd/github-actions">GitHub actions</a> being one of them.</p><h4>Running load tests using GitHub actions</h4><p>The workflow to run load tests is simple to set up using the <a href="https://github.com/artilleryio/action-cli">official artillery GitHub action</a>. Below is an example workflow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aed7a42e3cf313f5dacf27fb6c61c17/href">https://medium.com/media/0aed7a42e3cf313f5dacf27fb6c61c17/href</a></iframe><p>Instead of running the load test on push to main branch or opening a pull request, I kept it on-demand using workflow_dispatch trigger. We can provide the necessary parameters to run the test when you run this workflow using GitHub website. Please see below screen grab for running this workflow:</p><figure><img alt="text field to provide inputs to artillery github action workflow" src="https://cdn-images-1.medium.com/max/487/1*O1guYQ3Ef6kvjFylGtN4HQ.png" /><figcaption>Artillery workflow inputs</figcaption></figure><p>With this we have finally configured artillery to run via GitHub actions. I ran the test and found there is no memory leak but it is taking unusually long time for the memory graph to come down, which is a story for another time.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FHRVjHf4HbMUMpef5df%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fredbrick-mission-complete-leadpages-HRVjHf4HbMUMpef5df&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExYWJoMXk1MG5lNmdwd2RtMDZubWkzeHd0dGZkMG4zb3ByMDltMmVsbCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FHRVjHf4HbMUMpef5df%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2da153240e3cb184233602622b87c0c/href">https://medium.com/media/c2da153240e3cb184233602622b87c0c/href</a></iframe><p>Thanks for reading! Please let me know if you find this article helpful.</p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=788013c12dae" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/how-to-load-test-your-graphql-api-using-github-actions-and-artillery-788013c12dae">How to Load Test Your GraphQL API Using GitHub Actions and Artillery</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How medium and freecodecamp changed my perspective about web development]]></title>
            <link>https://medium.com/@suneethlenin/how-medium-and-freecodecamp-changed-my-perspective-about-web-development-be89146bcdb1?source=rss-43e2fc1d73c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/be89146bcdb1</guid>
            <category><![CDATA[freecodecamp]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[first-post]]></category>
            <dc:creator><![CDATA[Suneeth Lenin]]></dc:creator>
            <pubDate>Fri, 19 May 2017 03:07:42 GMT</pubDate>
            <atom:updated>2017-05-19T03:07:42.795Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*UVn5wQ9EnuqPSrfYGN4Whw.png" /></figure><p>I’m part of software development field since the inception of my career (which is comparatively short by the way). Soon after finishing college I got introduced to the world of web development in my first job (and only). It took me almost 6 months to realize that the technology stack that I’m working on is almost ancient and there are many big players in the market which I’m unaware of. From that point, I started paying attention to latest trends in web technologies but concentrated on back-end as I firmly believed that 90% of the logic lies in back-end code and UI is just a way to show things to the user (I had no idea about the importance/advantages of SPA at that time).</p><p>Later that year , as part of the product revamping/restructuring our technology stack changed and new terms SPA, REST, KnockoutJs, RequireJs etc were pushed into our minds. After the required and much needed research and googling I came to know that these things are not new and are part of the web since a long time back and some of them are now old. I started feeling outdated myself and kick started my front-end research in full swing. I still don’t know what triggered it, soon I started reading articles with java script framework comparison and it led me straight to <a href="https://medium.freecodecamp.com/angular-2-versus-react-there-will-be-blood-66595faafd51"><strong><em>Angular 2 versus React: There Will Be Blood</em></strong></a> published in freecodecamp medium page.</p><p>From that moment I didn&#39;t have to search any more, medium was an eye opener to me. All those things I craved for became readily available to me. I became a medium addict in no time. Articles from freecodecamp as well as from other publications and people helped me learn a lot of things and boosted my self confidence as I became more and more aware of what happening in web development.</p><p>I couldn’t help start doing freecodecamp challenges after that and it is slowly making me the web developer that I always wanted to become. I’m nearing the completion of front end challenges in freecodecamp and hoping to claim my Front End Development Certificate soon. The journey so far was awesome and made me realize that front-end development is as fun as back-end development but need more focus as there is a greater chance of getting yourself outdated as technologies here changes in matter of months if not in weeks. Now, with a breath of fresh air, I could say that I’m not ignorant anymore and promised my self that I never will be. I’m thankful to medium and especially freecodecamp for making me who I am now. Cheers!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be89146bcdb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>