<?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 Yusuf Tayman on Medium]]></title>
        <description><![CDATA[Stories by Yusuf Tayman on Medium]]></description>
        <link>https://medium.com/@yusuf-tayman?source=rss-e2c72506ef0b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JKRcraD-btP23h_4Cv38NA.png</url>
            <title>Stories by Yusuf Tayman on Medium</title>
            <link>https://medium.com/@yusuf-tayman?source=rss-e2c72506ef0b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:59:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yusuf-tayman/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[Cloud Make Things Easier, Which Make Things Harder]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://yusuf-tayman.medium.com/cloud-make-things-easier-which-make-things-harder-8b72ef11f8a4?source=rss-e2c72506ef0b------2"><img src="https://cdn-images-1.medium.com/max/1792/1*KqtGm748wdJX2He0GDDyFg.png" width="1792"></a></p><p class="medium-feed-snippet">Cloud computing has simplified infrastructure management, software deployment, and scalability. But, this simplicity can be deceptive. As&#x2026;</p><p class="medium-feed-link"><a href="https://yusuf-tayman.medium.com/cloud-make-things-easier-which-make-things-harder-8b72ef11f8a4?source=rss-e2c72506ef0b------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://yusuf-tayman.medium.com/cloud-make-things-easier-which-make-things-harder-8b72ef11f8a4?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b72ef11f8a4</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[k6]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Sat, 16 Dec 2023 14:31:02 GMT</pubDate>
            <atom:updated>2023-12-16T14:31:02.914Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[New Achievement Unlocked: Mastering Redis Performance with xk6-redis]]></title>
            <link>https://yusuf-tayman.medium.com/new-achievement-unlocked-mastering-redis-performance-with-xk6-redis-6e1e391200b4?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e1e391200b4</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[k6]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 08:39:15 GMT</pubDate>
            <atom:updated>2023-09-24T11:55:29.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hc7M8LNu2N5vDxGobXeIkQ.png" /></figure><p>In these times when even milliseconds are important, we may experience performance problems with Redis, which is indispensable for our applications. So how do we prevent this and how should we measure our Redis performance? Bringing together the three cornerstones of Observability, k6 gives us the key to performance this time and offers us <a href="https://github.com/grafana/xk6-redis">xk6-redis</a>.</p><h4>Redis</h4><p>Whilst <a href="https://redis.io/">Redis</a> is often thought of as a data structure server, it stands out for its ability to store and retrieve data at astonishing speed. Thanks to its in-memory storage mechanism, it minimises latency in the basic building blocks of our applications and offers us the ideal solution for issues such as caching, real-time analytics, and session management.</p><p>Imagine a real-time application where messages need to be delivered instantly to users around the world. With Redis, each message can be stored as a key and its recipients as values, enabling lightning-fast message delivery without straining the application’s resources.</p><p>However, it can sometimes fall victim to this speed, and as with any application, it can have problems, which can lead to data loss and poor user experience. Let’s talk about how to prevent it simply.</p><h4>xk6-redis</h4><p>The marriage of k6 and Redis gives us the key to performance on a golden platter. xk6-redis has the infrastructure to evaluate Redis under real-world conditions. Actually, we can predict everything right now.</p><p>For example, you know how many users and an increase will come to your system before Black Friday, but if you cannot simulate it. Thanks to xk6-redis, you can simulate the increase in user traffic or simulate the loads that will be experienced at the time of any sale. Well, good questions come into play here, Can I only test Redis or can I test any external structure that uses Redis?</p><blockquote>Welcome to k6, you cannot say no here because the answer to everything is yes.</blockquote><p><a href="https://github.com/grafana/xk6-redis">GitHub - grafana/xk6-redis: A k6 extension to test the performance of a Redis instance.</a></p><h4>Measure Redis Performance</h4><p>In order to use xk6-redis, we must first realise the power of k6 extensions. And we need to perform a small extra operation. Firstly we need to install xk6 and then we need to build the xk6-redis extension. We can do this with two simple commands.</p><ul><li>Install the xk6:</li></ul><pre>go install go.k6.io/xk6/cmd/xk6@latest</pre><ul><li>Build the binary:</li></ul><pre>xk6 build --with github.com/grafana/xk6-redis</pre><p>Now we can move on to our main operations. To connect to the Redis instance, we define our host and password information with the <em>redis.client</em> command.</p><pre>import redis from &quot;k6/x/redis&quot;;<br>import exec from &quot;k6/execution&quot;;<br><br>export const options = {<br>  scenarios: {<br>    redisPerformance: {<br>      executor: &quot;shared-iterations&quot;,<br>      vus: 10,<br>      iterations: 200,<br>      exec: &quot;measureRedisPerformance&quot;,<br>    },<br>  },<br>};<br><br>const redisClient = new redis.Client({<br>  addrs: __ENV.REDIS_ADDRS.split(&quot;,&quot;) || new Array(&quot;localhost:6379&quot;), // in the form of &quot;host:port&quot;, separated by commas<br>  password: __ENV.REDIS_PASSWORD || &quot;&quot;,<br>});</pre><p>Then we define our function and determine our key at first, Since it will be a parallel run, we assign a special key to each VU (Virtual User). In this way, we do not run our test on the same key all the time. First of all, we create our Redis key, then we increase the value with our <em>incrBy</em> property. Then we delete the key we created and check it.</p><pre>export function measureRedisPerformance() {<br>  const key = `redisKey-${exec.vu.idInTest}`;<br><br>  redisClient<br>    .set(`RedisKey-${exec.vu.idInTest}`, 1)<br>    .then(() =&gt; redisClient.get(`RedisKey-${exec.vu.idInTest}`))<br>    .then((value) =&gt; redisClient.incrBy(`RedisKey-${exec.vu.idInTest}`, value))<br>    .then((_) =&gt; redisClient.del(`RedisKey-${exec.vu.idInTest}`))<br>    .then((_) =&gt; redisClient.exists(`RedisKey-${exec.vu.idInTest}`))<br>    .then((exists) =&gt; {<br>      if (exists !== 0) {<br>        throw new Error(&quot;RedisKey should have been deleted&quot;);<br>      }<br>    });<br>}</pre><h4>Measure Redis Performance Using Redis Data</h4><p>Here we have a structure where we fetch data over Redis using GraphQL. First of all, we provide our connection to Redis again.</p><pre>import { check } from &quot;k6&quot;;<br>import http from &quot;k6/http&quot;;<br>import redis from &quot;k6/x/redis&quot;;<br>import { textSummary } from &quot;https://jslib.k6.io/k6-summary/0.0.1/index.js&quot;;<br><br>export const options = {<br>  scenarios: {<br>    usingRedisData: {<br>      executor: &quot;shared-iterations&quot;,<br>      vus: 10,<br>      iterations: 200,<br>      exec: &quot;measureUsingRedisData&quot;,<br>    },<br>  },<br>};<br><br>const redisClient = new redis.Client({<br>  addrs: __ENV.REDIS_ADDRS.split(&quot;,&quot;) || new Array(&quot;localhost:6379&quot;), // in the form of &quot;host:port&quot;, separated by commas<br>  password: __ENV.REDIS_PASSWORD || &quot;&quot;,<br>});</pre><p>Then, we create our load on the application by selecting random values on the key we set with <em>srandmember</em> via Redis.</p><pre>const book_ids = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);<br><br>export function setup() {<br>  redisClient.sadd(&quot;book_ids&quot;, ...bookIds);<br>}<br><br>export function measureUsingRedisData() {<br>  // Pick a random book id from the dedicated redis set,<br>  // we have filled in setup().<br>  redisClient<br>    .srandmember(&quot;book_ids&quot;)<br>    .then((randomID) =&gt; {<br>      const url = `https://localhost:4000/books/${randomID}`;<br>      const res = http.get(url);<br><br>      check(res, {<br>        &quot;status is 200&quot;: (r) =&gt; r.status === 200,<br>        &quot;content-type is application/json&quot;: (r) =&gt;<br>          r.headers[&quot;content-type&quot;] === &quot;application/json&quot;,<br>      });<br><br>      return url;<br>    })<br>    .then((url) =&gt; redisClient.hincrby(&quot;k6_book_fetched&quot;, url, 1));<br>}<br><br>export function teardown() {<br>  redisClient.del(&quot;book_ids&quot;);<br>}</pre><p>xk6-redis is not only limited to this, you can also create certain custom metrics, detail their outputs and access the metrics you want to focus on. For example, let’s examine <em>redis_latency</em>.</p><pre>import { Trend } from &#39;k6/metrics&#39;;<br>import redis from &#39;k6/x/redis&#39;;<br><br>const RedisLatencyMetric = new Trend(&#39;redis_latency&#39;, true);<br><br>export const options = {<br>  vus: 40,<br>  duration: &#39;10s&#39;,<br>};<br><br>const client = new redis.Client({<br>  addr: &#39;localhost:6379&#39;,<br>  password: &#39;&#39;,<br>});<br><br>export function setup() {<br>  client.set(&#39;key&#39;, &#39;value&#39;, 0);<br>}<br><br>export default function () {<br>  const start = Date.now();<br>  client.get(&#39;key&#39;);<br>  const latency = Date.now() - start;<br>  RedisLatencyMetric.add(latency);<br>}</pre><p>After setting a certain key and value in setup, we can control latency by performing continuous get operation. This situation can definitely change depending on the use of your applications. Our output will be as follows.</p><pre>iteration_duration...: avg=882.47µs min=56.33µs med=731.12µs max=15.32ms p(90)=1.2ms p(95)=1.5ms<br>iterations...........: 806755 70660.436149/s<br>redis_latency........: avg=804.8µs  min=0s      med=1ms     max=16ms    p(90)=1.1ms   p(95)=1.2ms</pre><p>On the other hand, you can find what you can do with xk6-redis here.</p><p><a href="https://k6.io/blog/benchmarking-redis-with-k6/">Benchmarking Redis with k6</a></p><h4>Conclusion</h4><p>By merging Redis’s efficiency with xk6-redis’s load testing prowess, developers can proactively fine-tune their Redis setups, preemptively addressing potential bottlenecks, and guaranteeing a seamless user experience even under the most demanding scenarios.</p><p>So, if you’re ready to elevate your Redis deployment to its peak performance, unlock the potential of xk6-redis, and embark on a journey to Redis performance mastery. Your applications — and your users — will thank you for it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e1e391200b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chaos as an Art: Fault Injection in Grafana k6]]></title>
            <link>https://yusuf-tayman.medium.com/chaos-as-an-art-fault-injection-in-grafana-k6-8f11a1908fe1?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f11a1908fe1</guid>
            <category><![CDATA[chaos-monkey]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Fri, 16 Jun 2023 14:25:49 GMT</pubDate>
            <atom:updated>2023-06-16T14:25:49.387Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1N2B_KoEoTe3uyy9zYi5zg.png" /></figure><p>In today’s complex and distributed systems, ensuring reliability is paramount. Chaos Engineering has emerged as a discipline to test system resilience by injecting controlled faults. xk6-disruptor is an extension for Grafana k6 that enables developers to incorporate Chaos Engineering principles into their performance testing. By injecting faults and simulating turbulent conditions, the xk6-disruptor helps uncover weaknesses and improve the reliability of your applications. In this article, we will explore the features and benefits of the xk6-disruptor, along with code examples showcasing its fault injection capabilities.</p><h4>Why xk6-disruptor?</h4><p><a href="https://github.com/grafana/xk6-disruptor">xk6-disruptor</a> offers several advantages for developers looking to enhance system reliability:</p><ul><li><em>Fast adoption and no surprises:</em> xk6-disruptor doesn’t require deploying and managing a separate fleet of agents or operators. It seamlessly integrates with Grafana k6 and aligns well with k6’s core concepts and features. This ensures a smooth adoption process without any unexpected complexities.</li><li><em>Easy extension and integration:</em> xk6-disruptor eliminates the need to combine multiple tools to achieve fault injection capabilities. It provides an extensive API for creating disruptors targeting specific components (e.g., Pods) and injecting various types of faults. This flexibility allows easy integration with other types of tests and complements your existing testing infrastructure.</li></ul><h4>Meet the xk6-disruptor with Code</h4><p>Let’s explore a code example to showcase the capabilities of xk6-disruptor:</p><pre>export default function () {<br>    // Create a new pod disruptor with a selector <br>    // that matches pods from the &quot;default&quot; namespace with the label &quot;app=my-app&quot;<br>    const disruptor = new PodDisruptor({<br>        namespace: &quot;default&quot;,<br>        select: { labels: { app: &quot;my-app&quot; } },<br>    });<br><br>    // Check that there is at least one target<br>    const targets = disruptor.targets();<br>    if (targets.length != 1) {<br>        throw new Error(&quot;expected list to have one target&quot;);<br>    }<br><br>    // Disrupt the targets by injecting HTTP faults into them for 30 seconds<br>    const fault = {<br>        averageDelay: 500,<br>        errorRate: 0.1,<br>        errorCode: 500<br>    }<br>    disruptor.injectHTTPFaults(fault, &quot;30s&quot;)<br>}</pre><p>In this example, we create a pod disruptor targeting pods from the “default” namespace with the label “app=my-app”. We then check if there is at least one target and proceed to inject HTTP faults, such as delays and errors. This allows you to simulate real-world scenarios and evaluate the resiliency of your application under turbulent conditions.</p><h4>Interactive Demo with KillerCoda</h4><p>Begin with a visit to <a href="https://killercoda.com/grafana-xk6-disruptor/scenario/killercoda">KillerCoda</a> and check the Catalogue Service is working. If you need to make sure you can exec the command easily through the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EeNe5FlwlNDh-M5GZrl_Q.png" /></figure><p>It’s time to inject faults, we inject the faults while browsing the products in the Catalog Service and thus turn the scene into a fire. 🔥</p><pre>import http from &#39;k6/http&#39;;<br>import { check } from &#39;k6&#39;;<br>import { ServiceDisruptor } from &#39;k6/x/disruptor&#39;<br>import { randomItem } from &#39;https://jslib.k6.io/k6-utils/1.2.0/index.js&#39;;<br><br>const products = [<br> &#39;a0a4f044-b040-410d-8ead-4de0446aec7e&#39;,<br> &#39;808a2de1-1aaa-4c25-a9b9-6612e8f29a38&#39;,<br> &#39;510a0d7e-8e83-4193-b483-e27e09ddc34d&#39;,<br> &#39;03fef6ac-1896-4ce8-bd69-b798f85c6e0b&#39;,<br> &#39;d3588630-ad8e-49df-bbd7-3167f7efb246&#39;,<br> &#39;819e1fbf-8b7e-4f6d-811f-693534916a8b&#39;,<br> &#39;zzz4f044-b040-410d-8ead-4de0446aec7e&#39;,<br> &#39;3395a43e-2d88-40de-b95f-e00e1502085b&#39;,<br> &#39;837ab141-399e-4c1f-9abc-bace40296bac&#39;,<br>];<br><br>export const options = {<br>   thresholds: {<br>       checks: [&#39;rate&gt;0.97&#39;],<br>    },<br>    scenarios: {<br>        load: {<br>          executor: &#39;constant-arrival-rate&#39;,<br>          rate:   20,<br>          preAllocatedVUs: 5,<br>          maxVUs: 100,<br>          exec: &#39;requestProduct&#39;,<br>          startTime: &#39;0s&#39;,<br>          duration: &#39;60s&#39;,<br>        },<br>        inject: {<br>          executor: &#39;shared-iterations&#39;,<br>          iterations: 1,<br>          vus: 1,<br>          exec: &#39;injectFaults&#39;,<br>          startTime: &#39;0s&#39;,<br>        }<br>    }<br>}<br><br>export function requestProduct() {<br>   const item = randomItem(products);<br>   const resp = http.get(`http://${__ENV.SVC_URL}/catalogue/${item}`);<br>   check(resp.json(), {<br>       &#39;No errors&#39;: (body) =&gt; !(&#39;error&#39; in body),<br>   });<br>   <br>}<br><br>const errorBody = &#39;{&quot;error&quot;:&quot;Unexpected error&quot;,&quot;status_code&quot;:500,&quot;status_text&quot;:&quot;Internal Server Error&quot;}&#39;;<br>export function injectFaults(data) {<br>    if (__ENV.INJECT_FAULTS != &quot;1&quot;) {<br>        return<br>    }<br><br>    const fault = {<br>        averageDelay: &#39;100ms&#39;,<br>        errorRate: 0.1,<br>        errorCode: 500,<br>        errorBody: errorBody,<br>        exclude: &#39;/health&#39;,<br>    };<br><br>    const svcDisruptor = new ServiceDisruptor(&#39;catalogue&#39;, &#39;sock-shop&#39;);<br>    svcDisruptor.injectHTTPFaults(fault, &#39;60s&#39;);<br>}</pre><p>Now let’s run the code, you need to add an env parameter when you run the script.</p><pre>xk6-disruptor run --env SVC_URL=localhost --env INJECT_FAULTS=1 ./test-front-end.js</pre><p>And here are the results that we expect the test to fail:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vR_LoQj6ExcLoMy3Jpxtng.png" /></figure><h4>Conclusion</h4><p>With xk6-disruptor, Grafana k6 users can leverage the power of Chaos Engineering to enhance the reliability of their applications. By injecting controlled faults and simulating turbulent conditions, xk6-disruptor enables developers to uncover weaknesses, improve resilience, and ensure the smooth operation of their systems. Incorporate fault injections into your performance testing and embrace the principles of Chaos Engineering to build more robust and resilient applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f11a1908fe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Five Myths of Observability]]></title>
            <link>https://yusuf-tayman.medium.com/the-five-myths-of-observability-64be03ef5d28?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/64be03ef5d28</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 13:19:11 GMT</pubDate>
            <atom:updated>2022-12-09T13:19:11.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fG4D21YhQIG4qBgYUzFEg.jpeg" /></figure><p>Observability is a term that has gained a lot of traction in recent years, particularly in the realm of software engineering and DevOps. At its core, observability refers to the ability to gain insight into the internal workings of a system by observing its external outputs. This allows engineers to diagnose and troubleshoot issues with the system, as well as to monitor its performance and behaviour.</p><p>However, despite its importance, there are a number of myths and misconceptions about observability that can lead to misunderstandings and misunderstandings about what it is and how it works. In this article, we will take a closer look at some of these myths and dispel them, as well as discuss the three pillars of observability that are essential for effective monitoring and troubleshooting.</p><h4>Myth #1: Observability is the same thing as monitoring</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FI3cLMV4W6W81JyCPkZ%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FI3cLMV4W6W81JyCPkZ%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FI3cLMV4W6W81JyCPkZ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="310" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebc8e35e28cb602cb0cc3c1f0624a9e2/href">https://medium.com/media/ebc8e35e28cb602cb0cc3c1f0624a9e2/href</a></iframe><p>One of the most common misconceptions about observability is that it is the same thing as monitoring. While monitoring certainly plays a role in observability, it is not the whole picture. Monitoring refers to the process of collecting data about a system, such as metrics and logs, and using this data to track the system’s performance and behaviour. Observability, on the other hand, goes beyond just collecting data and involves using this data to gain insight into the internal workings of the system.</p><h4>Myth #2: Observability is only relevant for large, complex systems</h4><p>Another myth about observability is that it is only relevant to large, complex systems. In reality, observability is important for any system, no matter how simple or small it may be. Even a simple web application with a handful of microservices can benefit from observability, as it can help engineers to diagnose and fix issues with the system quickly.</p><h4>Myth #3: Observability is only for production systems.</h4><p>Some people think that observability is only relevant for systems that are running in production and that it is not necessary for development or testing environments. However, observability is just as important in these environments, as it allows developers and testers to understand how their code is behaving and to identify and fix issues before they are deployed to production.</p><h4>Myth #4: Observability is only about metrics and logs</h4><p>While metrics and logs are undoubtedly important for observability, they are not the only aspects of a system that need to be monitored. In order to gain a complete understanding of a system, engineers also need to be able to observe the system’s behaviour, as well as its internal state. This requires a combination of different data types, including metrics, logs, and traces.</p><h4>Myth #5: Observability is only for reactive debugging.</h4><p>Finally, some people think that observability is only useful for reactive debugging, or for identifying and fixing issues after they have occurred. However, observability can also be used proactively, to monitor and improve the performance of a system, and to prevent issues from occurring in the first place.</p><p>In conclusion, the Five Myths of Observability are widespread misunderstandings that can lead to confusion and misinformation about this important concept. Observability is much more than just monitoring, it is relevant for systems of all sizes and environments. By understanding and dispelling these myths, developers can more effectively use observability to understand their system’s behaviour and performance and keep them reliable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64be03ef5d28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud-Native Test Orchestration]]></title>
            <link>https://yusuf-tayman.medium.com/cloud-native-test-orchestration-bbf7c1ed86dc?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbf7c1ed86dc</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[testkube]]></category>
            <category><![CDATA[cloud-orchestration]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Sun, 09 Oct 2022 12:42:44 GMT</pubDate>
            <atom:updated>2022-10-10T10:00:04.104Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous <a href="https://yusuf-tayman.medium.com/hidden-gems-of-testkube-k6-and-kubernetes-f9b17244f976">article</a>, we learned the working logic of testkube by making an example with k6. In this article, I will show you how to make the orchestration aimed by testkube.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UXuyd6K2B1-seEQPJUG0yQ.png" /></figure><h4>Testkube Executors</h4><p>There are a few important points we need to learn about testkube before we move on to orchestration processes.<br>Testkube currently works with executors. These executors make our tests run by adapting them in the Kubernetes environment in the back to make our tests run. Since many tools and frameworks are used today, some are officially supported now. These are the most common tools we use in the testing and development world such as k6, cypress, postman, SoapUI, maven, gradle, cURL, KubePug, and Ginkgo. Apart from these, there is no need to worry if there is any executor that you want to use but is not on this list. Testkube has lovely documentation and a system allowing you to create a custom executor.</p><p><a href="https://kubeshop.github.io/testkube/category/test-types">Test Types | Testkube Documentation</a></p><h4>Testkube Test Suites</h4><p>We used only k6-executor in our previous article, now we will add cypress to it. Thus, we will create a test suite and run our performance and UI tests under a single suite. So what is this test suite, test suite allows us to run the tests we created on testkube under a single suite. So this means that before you create a testsuite, you need to have tests created with testkube. Let’s start with an example, first I will create a test for k6, and then I will create it for cypress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJnNLluV9c9H0UeYTGqR6A.png" /></figure><p>To create a test for k6, I’ve added a simple js file beforehand and using it I’m creating my test with the simple testkube command.</p><pre>kubectl testkube create test -f test.js — name testkube-k6 — type k6/script</pre><p>Now it’s my turn to create a test for cypress. I will use testkube’s example repository for this.</p><blockquote>I want to mention an important point here, this is one of the cons that I see, if you want to create a test for cypress, your code must be on github, like normal k6, it cannot detect the project from local. I hope there will be support for local files in the future.</blockquote><p>As you can see in the command below, we add the repository link via git-URI, then we need to specify the path of whichever path our tests are under, and finally, we add cypress/project as the type and run our command.</p><pre>kubectl testkube create test — git-uri <a href="https://github.com/kubeshop/testkube-executor-cypress.git">https://github.com/kubeshop/testkube-executor-cypress.git</a> — git-branch main — git-path examples — name testkube-cypress — type cypress/project</pre><p>Now my tests are ready for both cypress and k6. In order to check whether my tests are formed properly, I list and check our tests with the following command.</p><pre>kubectl testkube get tests</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzB4AnGpl1UwkP_4VGEx-Q.png" /></figure><p>Our tests are done properly now it’s time to create a test suite. We need a JSON file to create a test suite. This JSON file contains the name, description and steps of our test suite. We need to give you which testkube test you need to execute in the steps. We use the names of the tests we created above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0B7BbXvaUd61Hw-170yCA.png" /></figure><p>After creating our JSON file, we now need to create a test suite. When creating Testsuite, you must provide the JSON file and name you created as the file.</p><pre>kubectl testkube create testsuite -f testkube.json — name testkube-suite-example</pre><p>Now let’s check if our test suite is formed correctly. We will use the same command that we used when checking our tests above, in fact, we will only get test suites instead of the test as type.</p><pre>kubectl testkube get testsuites</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sG8K6DEEV7fhSD5qBVkinA.png" /></figure><p>Yes, we see that our test suite has formed properly, now it’s time for the magic. Let’s run our test suite and see what’s going on.</p><pre>kubectl testkube run testsuite testkube-suite-example</pre><p>We see the details of our test suite on the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y7HvkMI3dNsE3Lhg1eDPtw.png" /></figure><p>I’ll show you the execution details output. As you can see, all of our steps have worked without any problems and we see that has passed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Van_9a3ilAecrY_H7MFYVw.png" /></figure><p>So, where do we get the detailed metrics, testkube provides us with a dashboard, if you want, we can use the dashboard or you can access the execution details it offers us by sending a message on slack. In my next article, I will be with you on sending testkube dashboard and metrics to slack.</p><p>Waiting for your comments here, <a href="https://www.linkedin.com/in/yusuftayman/">LinkedIn</a> or <a href="https://twitter.com/yusuftayman">Twitter</a> and if you liked the article, you can let me know with applause. 🫡</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbf7c1ed86dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hidden gems of Testkube: k6 and Kubernetes]]></title>
            <link>https://yusuf-tayman.medium.com/hidden-gems-of-testkube-k6-and-kubernetes-f9b17244f976?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9b17244f976</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[testkube]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 13:05:35 GMT</pubDate>
            <atom:updated>2022-09-26T13:05:35.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MaG7r9mTB_4tCKBp.jpg" /></figure><h4>Introduction Testkube</h4><p>Many times we may need to orchestrate our API, UI and performance tests in different places. This can often be a somewhat challenging process in terms of test management. Especially when we want to manage and monitor different test suites in one place, we have to make complex configurations.</p><p>Testkube actually gives us the answer to all these questions. By its own definition, Testkube is a Kubernetes-native testing framework. Testkube allows us to execute and monitor all our functional, performance, and security tests from one place within the Kubernetes cluster. Testkube also allows us to run different test files by fetches from repos. It allows us to manage all testing activities through Testkube, eliminating the complexity in CI/CD processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*qzwUMuss1pSUx_hPtIyX1A.png" /></figure><p>In this article, I will show you how you can make a difference in the world of load testing with TestKube. We will do this using k6 and as you know k6 is one of the most used and most popular load test tools of the last period.</p><h4>Hidden gems of Testkube: k6 and Kubernetes</h4><p>When we want to run our tests with k6 in the Kubernetes environment, we come up with a few options, one of them being the k6-operator developed by k6. If you want, you can perform these operations using the k6-operator, but the process here may lead us to different configurations and complexity. Testkube comes into play here and integrates with k6 in Kubernetes in a very short time and solves all the problems I mentioned above.</p><h4>Installation Testkube</h4><p>You can proceed through the documentation for Testkube installation ( <a href="https://kubeshop.github.io/testkube/installing">https://kubeshop.github.io/testkube/installing</a> ).</p><p>I’m going to do a quick install for Homebrew for macOS.</p><pre>brew install testkube</pre><p>After installing testkube, we also need to install testkube components on our Kubernetes clusters.</p><pre>kubectl testkube install</pre><p>That’s all, we are now ready to run our test on the cluster.</p><h4>Create a Test</h4><p>Let’s quickly write a k6 test and witness how easy and developer-friendly k6 is again.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fjsfiddle.net%2F5yqt8n07%2F3%2Fembedded%2F&amp;display_name=jsFiddle&amp;url=https%3A%2F%2Fjsfiddle.net%2F5yqt8n07%2F3%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=jsfiddle" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd5bdbb6cf5a525ba1ff24379b4dfc98/href">https://medium.com/media/fd5bdbb6cf5a525ba1ff24379b4dfc98/href</a></iframe><p>After creating our test, let’s save it as k6-example.js.</p><h4>Define and Run Tests into Testkube</h4><p>After that, it is very easy to leave yourself in the hands of testkube and run your test with two commands.<br>First of all, you need to define it with “k6/script” type.</p><pre>kubectl testkube create test --file path/to/your/k6-example.js       --type &quot;k6/script&quot; --name k6-test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*5rkmV802vluSi7kt1AkOPg.png" /></figure><p>After we see that our definition is done as a success, we can now run.</p><pre>kubectl testkube run test k6-test -f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-unT1H87weGfk94CK0TRfg.png" /></figure><p>Our test started to run successfully and we can check the logs automatically from where we run it. Apart from this, it also provides us with the commands that we can pull logs in detail after the execution is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBQey00snu5-jesKs7kqbA.png" /></figure><p>Apart from all these details, we can also see the extra logs and results on the dashboard provided by Testkube.</p><p>Now you have run your k6 load test with cloud-native way over Kubernetes cluster. Now it’s time to integrate API and UI tests and run them all together. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9b17244f976" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turn any process into a step-by-step guide: Scribe]]></title>
            <link>https://yusuf-tayman.medium.com/turn-any-process-into-a-step-by-step-guide-scribe-6aa82c5d2cd1?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6aa82c5d2cd1</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[onboarding]]></category>
            <category><![CDATA[scribe]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 11:11:39 GMT</pubDate>
            <atom:updated>2022-09-16T11:11:39.078Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Turn on the Scribe recorder, go through your process, and then turn off the recording that&#39;s it.</blockquote><p>As a QA Engineer, documentation has played an important role in every aspect of our lives. The use of test tools, regularly recording bugs, creating documentation of test cases, and making documentation of how to test each part of the system separately, because all these processes are very important for Developers, Product Managers and QAs who will start new work.</p><blockquote>“Time savings is the most important thing for us. It’s been massive. I can record 150 steps in five minutes with Scribe.”</blockquote><blockquote>Daniel Owen, Quality Assurance Team Lead</blockquote><p>These are usually time-consuming tasks. We always use different tools for these works. But in this article, I come to you with such extensions that it is a tool that knows the value of your time and will save you from a lot of burdens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iJmC0iS92KjD51Zl" /></figure><p>Let’s meet Scribe. Scribe is a step-by-step documentation tool. But do not confuse Scribe with other recording tools, because it is one of my favourite features that you can use very easily in every field and it generates a description for you.<br>Now it’s time to go deeper, let’s examine which phases of our business life we ​​can implement. The important point here is that besides the use cases I will show below, how you will use it effectively is more important because each company can have different dynamics.</p><h4>Overview of Scribe</h4><p>Let’s make an example. While reading or reviewing an article on Medium, let’s answer the question of how to make a documentary with Scribe. In a very simple way, we start the record by clicking Scribe in the extensions section, then we perform our operations and after clicking complete recording, Scribe generates all the steps you have visited with their explanations in the form of workflow.</p><figure><img alt="https://cdn-images-1.medium.com/max/1600/1*zNsdBy7ItqJo5jDMS_1ktQ.gif" src="https://cdn-images-1.medium.com/proxy/1*zNsdBy7ItqJo5jDMS_1ktQ.gif" /></figure><p>So what can we do with this workflow? Let’s examine it step by step.<br>You can describe exactly what your workflow does with a general description.</p><figure><img alt="https://cdn-images-1.medium.com/max/1600/1*QbsHMPmS77e4eI4PUtpWHw.png" src="https://cdn-images-1.medium.com/proxy/1*QbsHMPmS77e4eI4PUtpWHw.png" /></figure><p>You can change the descriptions in your steps.</p><figure><img alt="https://cdn-images-1.medium.com/max/1600/1*myKkCtFPou_YnU3jQ_2BOA.png" src="https://cdn-images-1.medium.com/proxy/1*myKkCtFPou_YnU3jQ_2BOA.png" /></figure><p>You can delete your steps or just share them as a single step.</p><figure><img alt="https://cdn-images-1.medium.com/max/1600/1*yfnpL7CU6L9DWxwmCbdCiA.png" src="https://cdn-images-1.medium.com/proxy/1*yfnpL7CU6L9DWxwmCbdCiA.png" /></figure><p>You can change the order of your steps and add a new step between them.</p><figure><img alt="https://cdn-images-1.medium.com/max/1600/1*QqoEVsxDB6AGh1-DluXoJQ.gif" src="https://cdn-images-1.medium.com/proxy/1*QqoEVsxDB6AGh1-DluXoJQ.gif" /></figure><p>You can merge all of your steps or make changes by selecting specific steps or sharing them with your team.</p><p>As you can see, you can access many of its features for free, as well as I tried to explain where you can use it below in order to have an idea in your mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tFgKD_3fXJlIwmjA" /></figure><h4>Test Case Generation &amp; Bug Report</h4><p>Using Scribe, you can easily visualize your test cases or add supporting flows to your bug tasks, this will save both you and the developers time to understand or reproduce the tasks.</p><h4>Answers Questions &amp; Training Documentation</h4><p>Tired of the same questions over and over? Or you had to tell different people about some part of it too many times in the system. You don’t want to waste time with these anymore and you want to focus on different things How do I… with Scribe. You can create sections in seconds.</p><h4>Build Training Materials</h4><p>With Scribe, you can easily create your own wiki or knowledge base. You can create high-quality documentation to tell others about new technologies or a system you have just implemented.</p><h4>Onboard New Hires</h4><p>You can create a more effective time for both the new recruit and you by supporting the onboarding processes in seconds with screenshots of new hires.</p><h4>Onboard New Customers</h4><p>Or you are onboarding a new customer and you need to explain the system to him, and when you enter the meeting by preparing a good document, there will be no question mark in mind, you will not have to show the same steps again and again. It will be an effective shopping for both your customer and you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6aa82c5d2cd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Interactive Slack Bot: Part One]]></title>
            <link>https://yusuf-tayman.medium.com/serverless-interactive-slack-bot-part-one-fe2cf04445e3?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe2cf04445e3</guid>
            <category><![CDATA[slack]]></category>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Sun, 12 Jun 2022 15:25:30 GMT</pubDate>
            <atom:updated>2022-06-12T15:27:41.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="serverless-slack-bot" src="https://cdn-images-1.medium.com/max/1024/1*2YAxLGx4vrtW75i8PzV9RQ.png" /></figure><p>In this article, I will demonstrate how we integrate the slack bot into google cloud functions and we will understand how slack functionalities are working which is receiving a simple message you send on the slack.</p><p>Why do we need to slack bot, slack bot enables us to automate our daily work interactively according to the dynamics within the company we work for. For example, a new person joins your team and you need to explain the onboarding processes to him, everything is ready, but you just need to guide us. Or, as a very different event, you can do all your deployment processes with slack bots, you can create automatic merge requests using Github and GitLab APIs depending on the version control system you use, or you can create commands that will trigger deployments these merge requests.</p><h4>Create Slack App</h4><p>First of all, we need to create an app through the slack environment we use for our slack bot, you can simply create your app by following the steps below.<br>When we go to api.slack.com/apps, the Apps page greets us here, where we can create our first app by clicking Create New App.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwKD-b3221oaFBfZtnOqNg.png" /></figure><p>Slack offers us two options, we will continue with the first one because we have to create it from scratch, but to explain the second option if you have different apps, it automatically creates an app with the same features by copying the manifests there.<br>We continue the from scratch option and we enter the app name and select workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1Qw9Csyge1C00tb8waQkQ.png" /></figure><p>After clicking Create App, we can now start using our app. As the next step, there are two things we need to connect us to the app, one is Bot Token and the other is Signin Secret. We can get Signin Secret from the Basic Information page that opens first. For Bot Token, we need to define a scope first, about what our app will access, you can do this by clicking Add New Scope in the Scope field in the OAuth &amp; Permissions tab. We will use chat:write for now. After adding the scope, you can add your app workspace by clicking Install to Workspace and see that your token is created automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m1P0tpj4k2iVLrQb.png" /><figcaption><a href="https://slack.dev/bolt-python/concepts">https://slack.dev/bolt-python/concepts</a></figcaption></figure><blockquote>You can find more information about scope and what scopes do here. <a href="https://api.slack.com/scopes">https://api.slack.com/scopes</a></blockquote><h4>Create Cloud Function</h4><p>First of all, why do we need to use a serverless structure, let’s take a look at it first? When using Slack apps, all processes are built on request-response infrastructure, we need to trigger a slack bot somehow over a structure, and after triggering, we need to be able to perform the necessary actions by listening to the requests. The serverless structure will help us here.</p><p>Let’s create the first cloud function, first, we go to the cloud functions over the console. Then we click on Create Function, Configuration page welcomes us, here we set Function Name and Authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2B_oNi_dG-ItS6XSDdcqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDWLhQi3iwaihVM2ugW3MQ.png" /></figure><p>Here we get our URL. We will use it in Slack bot integration. Then, we switch to the Code tab, here we choose python for our bot, since we will write with Python, two automatically generated files are automatically sent to us as the default cloud function, main.py and requirement.txt, and we deploy them together with them, now the cloud function is ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RouXgGfb7BH5D93n0C2yRw.png" /></figure><h4>Integrate Cloud Function and Slack</h4><p>We go back to Slack App and enable event subscription from the Event Subscription tab here, then enter the cloud function URL we got above here. Thus, our cloud function will be triggered with every event we do on slack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBXJYQXChNBdyLW0KAe--g.png" /></figure><p>You can choose which events to subscribe to from the Subscribe to bot events field on this page. These events are the same as the scopes we mentioned above, you can subscribe to events according to your own needs.<br>Everything is ready, let’s write our bot.</p><h4>Bolt-Python Slack Bot</h4><p>We will create our bot with Bolt. Bolt is simply a Python framework with which you can create and manage your Slack Apps. After importing Bolt, we connect to our bot with the bot token and signin secret that we received when we first created our slack app with the App, then let’s make our first example with our bot with the mentioned event. In order to do this, we specify which event we will access with the app.event tag is provided by the bolt framework.</p><p>You can easily access and process which events you can use here. Then, we can enable our bot to react with the say function that Bolt offers us.</p><p>The first two parameters that are important for the count function are channel and the other is message or blocks. You can determine where you can send a message with the value you give in the channel. You need to give channel_id or user_id here. You can automatically call the body parameter of the function you created to get these ids. You can take the event values that you sent slack together with the body, and you can use them by getting the channel id and user id from here, we will proceed with the channel id. Then we will use blocks that allow slack to send us interactive messages.</p><blockquote>Here you can create your own slack blocks and see how interactive messages can be created. <a href="https://app.slack.com/block-kit-builder/">https://app.slack.com/block-kit-builder/</a></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6324b26466a5a660bd1e86d9f8448583/href">https://medium.com/media/6324b26466a5a660bd1e86d9f8448583/href</a></iframe><p>After creating our block via block-kit-builder, we can now deploy our app. We can easily deploy our app with the command below.</p><pre>gcloud functions deploy slack-bot --runtime python39 --trigger-http --allow-unauthenticated</pre><p>After the app is deployed, let’s mention our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*EZtC9msKFPJ8kvDCEfjTJg.png" /></figure><p>As you can see, our bot was triggered and got back to us for mentioning it. Well, can we only trigger it with a mention, of course, no, let’s see how we can trigger it with the message.</p><p>If ‘hey’ is mentioned in the message, let the app be triggered, we use the app_message event for this and add a keyword we want into it, and trigger it after deploying it in the same way.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/491c9282b8b001e80a61fe8a6b344d39/href">https://medium.com/media/491c9282b8b001e80a61fe8a6b344d39/href</a></iframe><p>Yes, we triggered our bot with the ‘hey’ message. You can use the keywords you want here. Don’t forget to take a look at the bolt document for more listeners or to create interactive messages or actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qarpOWajDZUcDwqaBK45CA.png" /></figure><p>Wish you to create enjoyable slack bots 🤓</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe2cf04445e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Payment Webhooks: Test and Validate Webhooks]]></title>
            <link>https://medium.com/openpayd-tech/payment-webhooks-test-and-validate-webhooks-33ab003069db?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/33ab003069db</guid>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[ngrok]]></category>
            <category><![CDATA[embedded-finance]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Mon, 16 May 2022 15:55:55 GMT</pubDate>
            <atom:updated>2022-05-16T16:04:14.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qe4q2xM7tewQ0UH0F9zew.png" /></figure><h3>What’s the Importance of Payment Webhooks?</h3><p>Webhooks are now widely used in today’s embedded finance services. Customers want to receive the state of transactions as part of our embedded finance services so that they can immediately be notified as things have been changed. The solution accepted globally is to use webhooks, and we did it so. Getting those webhooks from the customer&#39;s perspective is crucial for their whole business. Therefore, the importance of the tests of webhooks is a key and crucial part of our embedded finance services as well.</p><h3>What — is the Our Main Problem</h3><p>As the inherent of all HTTP based tests requires flexibility as much as possible, we needed to create a customized infrastructure to handle it that would work in a dynamic way. What I mean by the word “dynamic” is that we should also handle the irrespective requests in order to completely make sure the webhook infrastructure works as we really designed.</p><p>In order to do this, we needed two things:</p><p>* A system where we could listen to webhooks</p><p>* A URL to provide within the definition of the webhooks as a tunnel to the host that our tests run on.</p><p>In this article, we’ll demonstrate how we integrated ngrok and httpServer to work together in order to serve us as an infrastructure of our webhook tests.</p><h3>Why do we use Ngrok?</h3><p>The development of webhook tests is the initial point that we investigated initially. The reason is that every QA Engineer needs their own independency. I’m pretty sure no one wants to get a webhook triggered by someone else&#39;s local. A proxy to the local, as well as the host that actual QA tests run, became the most important requirement for the overall infrastructure. Also, as the teams can have inexperienced engineers, the product would also be easy-to-configurable as a key feature.</p><blockquote>Ngrok gives us the ability to introspect incoming http calls in real time.</blockquote><p>I aware of the Ngrok for many years but I have never ever thought it could be managed through Java, and here is the solution shines.</p><blockquote><a href="https://github.com/alexdlaird/java-ngrok">https://github.com/alexdlaird/java-ngrok</a></blockquote><h4><strong>Configuring the HTTP Server</strong></h4><p>Ngrok requires an HTTP Server to redirect requests to. Basically speaking, the market is full of such kinds of solutions but the thing we expect was a lightweight and, if possible, a built-in one inside Java ecosystem. After a quick investigation, Java’s built-in Http Server came to the scene. The reason why we used it in a single word is its flexibility.</p><p>The Http Server allows us to listen all the incoming HTTP requests to a specified port.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94d8d57ae5a635b2815856a83caac7e2/href">https://medium.com/media/94d8d57ae5a635b2815856a83caac7e2/href</a></iframe><p>As you can see with the gist above, its easy to configure and requires no external dependency to construct. Also no overhead to listen all the incoming request, nonetheless to configure a specific URL. Based on those prons of it, the Http Server was the best candidate to go with.</p><p>Now, we have two separate product to integrate each others to work as an infrastructure for our webhook tests.</p><h4>Configuring the Ngrok-Client</h4><p>As mentioned above, the <a href="https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com/github/alexdlaird/ngrok/NgrokClient.html">NgrokClient</a> provide all the functionalities of ngrok through an Java API. Just open a tunnel by using the <a href="https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com/github/alexdlaird/ngrok/NgrokClient.html#connect(com.github.alexdlaird.ngrok.protocol.CreateTunnel)">connect</a> method, which returns a Tunnel, and this returned object has a reference to the public URL generated by ngrok, which can be retrieved with <a href="https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com/github/alexdlaird/ngrok/protocol/Tunnel.html#getPublicUrl()">getPublicUrl()</a>.</p><p>With the sample below, we built NgrokClientand open a new tunnel through the ngrok.</p><p>Please make sure that you run the Http Server snippet above which means there is a listener listens for Http requests came through the port number assigned to the variable port. Also make sure you passed same port variable to the code snippet below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e154fe4a9fde849bbc2953be99aec078/href">https://medium.com/media/e154fe4a9fde849bbc2953be99aec078/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-bvZxLeL8FIBCKuI7OKBXw.png" /></figure><h3>Listen to the Requests Through the Ngrok-Client</h3><p>Integration of Http Server and Ngrok was the first thing that we need to solve. But the journey just started. The collection of request and timing of them were also the problems that we need to pay more attention. Also, the worst one was how many times we should wait for a webhook for. you can listen to the requests according to the timeout you give according to the Webhook content you have created here, and if more than one operation is performed on the same path, you can easily see and handle them.</p><p>The most important part is the part how we collect the requests. We collected the requests because opening and closing sockets and creating a tunnel on Ngrok is an expensive for engineering perspective. Also, those kind of heavy usage of Ngrok is out of their free usage. So, creating a single Http Server and Ngrok tunnel and consuming it in entire test run also become an inevitable requirements. This is why we collected them.</p><p>In addition to these, if we have tests running in parallel at the same time and if they use the same path, we listen to them and check them. In this way, the webhooks do not interfere with each other and we save ourselves from false alarms.</p><h4>Collecting The Incoming Http Requests</h4><p>In order to collect requests and immediately return it to the awaiting tests, we heavily used the Java’s Inter Thread Communication.</p><p>The first thing was to create an ConcurrentHashMap to collect all the incoming requests grouped by path. We differentiated the value of that key so that we can understand whether the key is registered by callee — in our case it is the webhook test — or created by before the key registration. The main motivation to create a default listener was to handle the incoming requests before the registration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a00f652b4ec4367e6b9afdce93b520c/href">https://medium.com/media/1a00f652b4ec4367e6b9afdce93b520c/href</a></iframe><p>As you can see with the gist above, we collected all the incoming requests in a stack and differentiated the type of instance based on the registration type, the incoming requests with no previous registrations registered with DefaultStack which is an implementation part of our solution and a regular Java’s built-in stack if it is a user registration.</p><p>The latter we did is to consume the Inter Thread Communication feature of java to notify any waitor by using the registration as our mutator. The synchronized block in snipped above is added for this purpose.</p><p>If there is an registration at the same time, the callee of registration wait for given amount of secs for timeout:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aad2f7ac13595d9a91e6d664dbb756f/href">https://medium.com/media/0aad2f7ac13595d9a91e6d664dbb756f/href</a></iframe><p>As you can see in snippet above, we created a stopWatch to measure how much time spent to decide for a timeout, checking the existence of an mutator with DefaultStack and if not exists, registering a new one and waiting to receive a request for given timeout.</p><h4>How To Test Things?</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d9f2553227c5a651f3760fb1ebfd50a/href">https://medium.com/media/2d9f2553227c5a651f3760fb1ebfd50a/href</a></iframe><h4>Conclusion</h4><p>Within this medium article, we go through the solution we did to test webhooks. We know that it has some drawbacks for a general usage as a ready-to-use solution but the purpose of it was to create a solution that we can consume for the needs that the company needs. The motivation was to demonstrate a way to achieve it and it is doable without requiring complex solutions.</p><p>You can find the complete solutions from that github repository.</p><blockquote><a href="https://github.com/yusuf-tayman/ngrok-webhook">https://github.com/yusuf-tayman/ngrok-webhook</a></blockquote><p>Feel free to feedback and enjoy your webhooks today🤓</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FSYyRbbeXAgTuIkZGqu%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FSYyRbbeXAgTuIkZGqu%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FSYyRbbeXAgTuIkZGqu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d6d677504a1775f0a97da17b3ee8c8f/href">https://medium.com/media/8d6d677504a1775f0a97da17b3ee8c8f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33ab003069db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/openpayd-tech/payment-webhooks-test-and-validate-webhooks-33ab003069db">Payment Webhooks: Test and Validate Webhooks</a> was originally published in <a href="https://medium.com/openpayd-tech">OpenPayd Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Copilot: A Practical Overview with k6]]></title>
            <link>https://medium.com/geekculture/github-copilot-a-practical-overview-with-k6-98c179d8e73d?source=rss-e2c72506ef0b------2</link>
            <guid isPermaLink="false">https://medium.com/p/98c179d8e73d</guid>
            <category><![CDATA[k6]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Yusuf Tayman]]></dc:creator>
            <pubDate>Mon, 27 Dec 2021 15:23:43 GMT</pubDate>
            <atom:updated>2021-12-28T08:17:42.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObxAErPqFYsyhrnGLelCPg.png" /></figure><h3>What is the Github-Copilot?</h3><p>Basically, Copilot is a cloud service. The cloud service is a code prediction engine powered by OpenAI Codex, a language model trained on billions of code.</p><p>Also, you need to know that Codex is a code _synthesizer_, not a search engine.</p><h3>How does Github-Copilot work?</h3><p>Copilot editor extension sends your comments and code to the GitHub Copilot service, which then uses OpenAI Codex to synthesize and suggest code. it actually works by reading through all the open-source code on the GitHub repos and then collecting the data and trying to find the best possible code related to it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*kI-tbNY13txYzP7H" /></figure><p>You can think of the Github co-pilot as your pair programming friend. Copilot only offers you the codes it has seen before or the code samples you use in your project.</p><h3>Overview Github-Copilot x k6</h3><p>First of all, we need to specify options for the load test, for example, how many minutes will we create a load. You can see in the example below how we can quickly create this test without knowing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmJyHbPGEU1oSrXASUajHw.gif" /></figure><p>In the example below, you can see how we created a simple get request with copilot with the JSON placeholder fake API.<br>While creating this load test, we have also performed our status code control by using the k6 check method. The main reason we use k6 is that it provides support with a lightweight language such as javascript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HDOyJ8r3K5LqvGyk-TD7yg.gif" /></figure><p>Now let’s use the k6 group feature, you could use groups to organize multiple requests and different scenarios. I want to group POSTS and COMMENTS endpoints, what we need to do is very simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIWTM1c9IlHRAvYUfjTH3g.png" /></figure><h3>Conclusion</h3><p>As a result, while you can write load tests very quickly with k6, with GitHub-Copilot this speed is very high and you can manage your time better. Let’s not forget that Copilot, our pair programming friend, will never take our job, don’t believe in such things, we just know how to use it effectively. 🤓</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98c179d8e73d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/github-copilot-a-practical-overview-with-k6-98c179d8e73d">Github Copilot: A Practical Overview with k6</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>