<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kürşat Aktaş</title>
    <description>The latest articles on DEV Community by Kürşat Aktaş (@kursataktas).</description>
    <link>https://dev.to/kursataktas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F725481%2Fe5c17d62-8749-4e46-8218-923da75dd09a.jpeg</url>
      <title>DEV Community: Kürşat Aktaş</title>
      <link>https://dev.to/kursataktas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kursataktas"/>
    <language>en</language>
    <item>
      <title>Alaz: Open-source, Self-Hosted, eBPF-based K8S Monitoring 🐝 🚀</title>
      <dc:creator>Kürşat Aktaş</dc:creator>
      <pubDate>Wed, 06 Sep 2023 17:43:26 +0000</pubDate>
      <link>https://dev.to/kursataktas/alaz-open-source-self-hosted-ebpf-based-k8s-monitoring-3g8i</link>
      <guid>https://dev.to/kursataktas/alaz-open-source-self-hosted-ebpf-based-k8s-monitoring-3g8i</guid>
      <description>&lt;p&gt;Hello Everyone ✋&lt;/p&gt;

&lt;p&gt;I'm excited to introduce a new open-source observability platform and would love to hear your feedback.&lt;/p&gt;

&lt;p&gt;We are aware that there are lots of open-source/commercial tools out there. However, we believe that monitoring the clusters and extracting actionable insights requires deep know-how about the tools/domain. We mainly focused on this problem.&lt;/p&gt;

&lt;p&gt;🐝 Alaz is an eBPF agent installed on your K8S cluster as DaemonSet. Thanks to eBPF - Alaz collects traces directly from Linux kernels. This means there's no need for sidecars, instrumentations, or service restarts.&lt;/p&gt;

&lt;p&gt;🎯 The UI not only visualizes data but also provides actionable insights. Using the Service Map, you can:&lt;/p&gt;

&lt;p&gt;View latencies and RPS between services.&lt;/p&gt;

&lt;p&gt;Detect zombie services and underperforming SQL queries.&lt;/p&gt;

&lt;p&gt;Monitor golden signals, such as 5xx status codes.&lt;/p&gt;

&lt;p&gt;In addition, Alaz can capture system resources like CPU, Memory, Disk, and Network through the Prometheus Node Exporter, which is embedded in the agent.&lt;/p&gt;

&lt;p&gt;Setting up is straightforward: just install Alaz as a DaemonSet, and the platform will handle the rest.&lt;/p&gt;

&lt;p&gt;Finally, the combination of Alaz and Ddosify Performance Testing makes it possible to do load testing and simultaneously monitor the system to find bottlenecks instantly.&lt;/p&gt;

&lt;p&gt;🚀 For those interested, check out &lt;a href="https://github.com/ddosify/alaz"&gt;Alaz on GitHub&lt;/a&gt;.&lt;br&gt;
Your feedback would be greatly appreciated!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>monitoring</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Load Testing a Fintech API with CSV Test Data Import</title>
      <dc:creator>Kürşat Aktaş</dc:creator>
      <pubDate>Mon, 13 Feb 2023 18:10:19 +0000</pubDate>
      <link>https://dev.to/kursataktas/load-testing-a-fintech-api-with-csv-test-data-import-3bib</link>
      <guid>https://dev.to/kursataktas/load-testing-a-fintech-api-with-csv-test-data-import-3bib</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oSe3muN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x02wxxos9hw8q3dzinw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oSe3muN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x02wxxos9hw8q3dzinw.png" alt="Testing the Performance of User Authentication Flow" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;We have organized this write-up into two parts to demonstrate two different features of &lt;a href="https://github.com/ddosify/ddosify"&gt;Ddosify&lt;/a&gt;. In the first part, we will perform a load test on a GET endpoint that accepts base and target currency and returns their exchange rate of them. The &lt;code&gt;rand()&lt;/code&gt; utility method is used to send different currencies on each request. In the second part, we will test a POST endpoint that performs exchange operations. We will use a CSV file that contains test data stored on our Test App's Database. Then we import this CSV file into Ddosify to replay the same transactions stored on DB, but in high concurrency. In both parts, we will gain insights into the reliability of our exchange API across high traffic.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Environment
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;As in the &lt;a href="https://ddosify.com/blog/testing-the-performance-of-user-authentication-flow"&gt;previous blog post&lt;/a&gt; we will again use the &lt;a href="https://testserver.ddosify.com/"&gt;Ddosify test API&lt;/a&gt; as a backend service.&lt;/li&gt;
&lt;li&gt;We will use Ddosify Open Source Load Engine version &lt;a href="https://github.com/ddosify/ddosify/releases/tag/v0.13.2"&gt;v0.13.2&lt;/a&gt;. If you didn't install it yet, you can follow &lt;a href="https://github.com/ddosify/ddosify#installation"&gt;the readme&lt;/a&gt; to find the proper installation method for your operating system.&lt;/li&gt;
&lt;li&gt;The configuration files used in this blog are available in &lt;a href="https://github.com/ddosify/blog_examples/tree/main/004_csv_import_blog"&gt;this repository&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Load testing the exchange rate info API
&lt;/h2&gt;

&lt;p&gt;Almost all fintech APIs have an endpoint that provides the exchange rate between two currencies. Our test backend API has a similar one, &lt;code&gt;GET exchange_rate/&amp;lt;base_currency&amp;gt;/&amp;lt;target_currency&amp;gt;/&lt;/code&gt;. In this use case, we would like to learn the performance of this endpoint by providing random &lt;code&gt;&amp;lt;base_currency&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;target_currency&amp;gt;&lt;/code&gt; on high IPS (iteration per second). Let's take a look at the below configuration first, then we will talk about the details of each section.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;fetch_exchange_rates.json&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"iteration_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"load_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"incremental"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"currencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"AED"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"ARS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"AUD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"BGN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"BHD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"BRL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"CAD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"CHF"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"CNY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"DKK"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"DZD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"EUR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"FKP"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"INR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"JEP"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"JPY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"KES"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"KWD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"KZT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"MXN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"NZD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"RUB"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"SEK"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"SGD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"TRY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"USD"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"baseUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://testserver.ddosify.com/exchange_rate"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Random Currency Fetch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{baseUrl}}/{{rand(currencies)}}/{{rand(currencies)}}/"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First of all, we have a list of currencies in our environment variables. If you wonder, we have fetched the supported currencies from the &lt;a href="https://testserver.ddosify.com/currencies/"&gt;https://testserver.ddosify.com/currencies/&lt;/a&gt; endpoint. The important part of this configuration is the URL field of the step. We used the &lt;code&gt;rand()&lt;/code&gt; utility method on both &lt;code&gt;&amp;lt;base_currency&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;target_currency&amp;gt;&lt;/code&gt; fields to inject a random currency. Before starting the test, we will use the &lt;code&gt;--debug&lt;/code&gt; flag to inspect request headers, request body, response headers, and response body. Ddosify sends only 1 request in debug mode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ddosify -config fetch_exchange_rates.json -debug

&amp;lt;.. truncated ..&amp;gt;
STEP (1) Random Currency Fetch
-------------------------------------
- Environment Variables
    currencies:    [AED ARS AUD BGN BHD BRL CAD CHF CNY DKK DZD EUR FKP INR JEP JPY KES KWD KZT MXN NZD RUB SEK SGD TRY USD]
    baseUrl:       https://testserver.ddosify.com/exchange_rate

- Test Data

- Request
    Target:     https://testserver.ddosify.com/exchange_rate/CNY/RUB/
    Method:     GET
    Headers:
    Body:

- Response
    StatusCode:    200
    Headers:
        Strict-Transport-Security:     max-age=31536000
        Content-Length:                17
        Connection:                    keep-alive
        Server:                        nginx/1.23.3
        Date:                          Wed, 08 Feb 2023 10:16:16 GMT
        Allow:                         GET, HEAD, OPTIONS
        Referrer-Policy:               same-origin
        Vary:                          Accept
        X-Frame-Options:               DENY
        Cross-Origin-Opener-Policy:    same-origin
        Content-Type:                  application/json
        X-Content-Type-Options:        nosniff
    Body:
        {
            "rate": 10.44834
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;You may notice that we use the &lt;code&gt;-debug&lt;/code&gt; flag on CLI instead of putting the &lt;code&gt;debug:true&lt;/code&gt; key in the configuration file as we did in the previous article. Although these two ways are valid ways to run Ddosify in debug mode, the CLI flag has priority over the debug key. In this use case, we choose to enable debugging on CLI for ease of use.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Looks like everything is as expected. We have successfully injected random currencies on the request URL and the response contains the exchange rate (10.44834) along with the &lt;code&gt;200 HTTP OK&lt;/code&gt; status code. We can remove the debug flag and start the test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ddosify -config fetch_exchange_rates.json

⚙️  Initializing...
🔥 Engine fired.

🛑 CTRL+C to gracefully stop.
✔️  Successful Run: 35     100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.08713s
✔️  Successful Run: 101    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.12753s
✔️  Successful Run: 207    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.13816s
✔️  Successful Run: 326    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.13880s
✔️  Successful Run: 455    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.13609s
✔️  Successful Run: 560    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.29128s
✔️  Successful Run: 821    100%       ❌ Failed Run: 0        0%       ⏱️  Avg. Duration: 0.43275s
✔️  Successful Run: 998     99%       ❌ Failed Run: 2        1%       ⏱️  Avg. Duration: 0.44565s


RESULT
-------------------------------------
Success Count:    998   (99%)
Failed Count:     2     (1%)

Durations (Avg):
  DNS                  :0.0851s
  Connection           :0.0120s
  Request Write        :0.0000s
  Server Processing    :0.2938s
  Response Read        :0.0000s
  Total                :0.4457s

Status Code (Message) :Count
  200 (OK)    :998

Error Distribution (Count:Reason):
  2     :connection timeout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we follow the real-time logs, we can easily analyze the &lt;code&gt;Avg. Duration&lt;/code&gt; increases over time. The reason is we set the &lt;code&gt;load_type&lt;/code&gt; as &lt;a href="https://github.com/ddosify/ddosify#incremental"&gt;incremental&lt;/a&gt; in the configuration file. That means the iteration count increases every second, so our API receives more and more requests per following second. As a final note, 2 requests have been timed out at the last second of the test, so our test API couldn't totally handle 1000 requests in 10 seconds on incremental traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incremental Load Type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BtGadRXc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/ddosify/ddosify/master/assets/incremental.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BtGadRXc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/ddosify/ddosify/master/assets/incremental.gif" alt="Ddosify linear load type" width="600" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Importing CSV data to replay network traffic
&lt;/h2&gt;

&lt;p&gt;In our test API there is a &lt;code&gt;POST /exchange&lt;/code&gt; endpoint that expects the amount, base currency, and target currency as request payload and it exchanges the given amount from the base currency to the target currency. Let's assume that our imaginary customers have used this endpoint many times and our servers started to slow down. The development team did some performance improvements and we would like to replay the last 1000 transactions to test the performance of the new system. This is a great example to demonstrate how to supply test data to Ddosify Engine.&lt;/p&gt;

&lt;p&gt;We exported the last 1K transactions from the database and save them to a CSV file called &lt;code&gt;test_data.csv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;test_data.csv&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;e746d910-bece-4c37-8e6b-325f89acc4d2,969.2,DZD,KWD
531dae65-2cf4-4194-867e-71c0ea7b6381,485.04,ARS,KZT
c0ec5795-2c37-4c08-a384-82f3444d445e,750.09,FKP,JEP
ba53bbdc-715d-4b72-99a2-867d4167861d,374.03,RUB,JPY
a087955c-3dbc-4164-b5a1-9def635107c7,971.02,SGD,SEK
&amp;lt;.. truncated ..&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CSV file consists of 4 columns. These are &lt;code&gt;api_key&lt;/code&gt; for authenticating the user for the transaction, &lt;code&gt;amount&lt;/code&gt;, &lt;code&gt;base currency&lt;/code&gt;, and &lt;code&gt;target currency&lt;/code&gt;. Now we can use the &lt;a href="https://github.com/ddosify/ddosify#test-data-set"&gt;CSV test data import feature&lt;/a&gt; of Ddosify Engine to resend these transactions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;transaction_replay.json&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"iteration_count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"duration"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"load_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"waved"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"baseUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://testserver.ddosify.com/exchange/"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"transactions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./test_data.csv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"vars"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"tag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"api_key"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"tag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"float"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"tag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"base_currency"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"tag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"target_currency"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"delimiter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;","&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"allow_quota"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"order"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sequential"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"skip_first_line"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"skip_empty_line"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Exchange"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{baseUrl}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"X-API-KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{data.transactions.api_key}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"payload_file"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./exchange_body.json"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;transaction_replay.json&lt;/code&gt; is our main configuration file. In the &lt;code&gt;data&lt;/code&gt; section we provide our CSV file in &lt;code&gt;transactions&lt;/code&gt; name scope, so we can use it in our steps as &lt;code&gt;{{data.transactions.tag}}&lt;/code&gt; format. There are lots of options we configured in this section, here are the details of them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We used &lt;code&gt;path&lt;/code&gt; to point the location of our CSV file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vars&lt;/code&gt; field is for matching the column index in the CSV to a variable name to use it in step configuration. For example, we named the first column in the CSV as &lt;code&gt;api_key&lt;/code&gt; then we use it in the &lt;code&gt;headers&lt;/code&gt; section of the Step, like &lt;code&gt;X-API-KEY": "{{data.transactions.api_key}}&lt;/code&gt;. Note that we also assigned the type of the second column as float since we want that Ddosify should treat amount values as a float instead of a string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;delimiter&lt;/code&gt; is the delimiter character of the CSV. While the default value of it is "," we type it to show you can use a custom delimiter.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;allow_quota&lt;/code&gt; enables the situation if a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field. Default is false. We put it to show this option. In our case, we don't expect quoted data in our CSV.&lt;/li&gt;
&lt;li&gt;We set the the &lt;code&gt;order&lt;/code&gt; as &lt;code&gt;sequential&lt;/code&gt; since &lt;strong&gt;we want to fetch the lines in the same order that is located in the CSV&lt;/strong&gt;. The default is &lt;code&gt;random&lt;/code&gt;, in that case, Ddosify fetches lines randomly from the CSV.&lt;/li&gt;
&lt;li&gt;We set &lt;code&gt;skip_first_line&lt;/code&gt; as &lt;code&gt;false&lt;/code&gt; because the &lt;code&gt;test_data.csv&lt;/code&gt; has no headers in the first line.&lt;/li&gt;
&lt;li&gt;Although we don't have any empty lines on our CSV file, we configured &lt;code&gt;skip_empty_line&lt;/code&gt; to show that there is an option like this.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;exchange_body.json&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{data.transactions.amount}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"base"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{data.transactions.base_currency}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{data.transactions.target_currency}}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;exchange_body.json&lt;/code&gt; is our POST payload, we filled the fields with the test data fetched from the CSV file. Let's debug our scenario and see what will happen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ddosify -config transaction_replay.json -debug

&amp;lt;.. truncated ..&amp;gt;

STEP (1) Exchange
-------------------------------------
- Environment Variables
    baseUrl:    https://testserver.ddosify.com/exchange/

- Test Data
    data.transactions.base_currency:      DZD
    data.transactions.target_currency:    KWD
    data.transactions.api_key:            e746d910-bece-4c37-8e6b-325f89acc4d2
    data.transactions.amount:             969.2

- Request
    Target:     https://testserver.ddosify.com/exchange/
    Method:     POST
    Headers:
        Content-Type:    application/json
        X-Api-Key:       e746d910-bece-4c37-8e6b-325f89acc4d2
    Body:
        {
            "amount": 969.2,
            "base": "DZD",
            "target": "KWD"
        }

- Response
    StatusCode:    200
    Headers:
        Allow:                         POST, OPTIONS
        &amp;lt;.. truncated ..&amp;gt;
    Body:
        {
            "amount": 2.1690696000000003,
            "currency": "KWD",
            "success": true
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Test Data&lt;/code&gt; section in the Debug result shows that we have successfully fetched the first row of our CSV file. Also, everything looks correct on the request payload and &lt;code&gt;X-Api-Key&lt;/code&gt; header value. Since we receive the &lt;code&gt;200 HTTP OK&lt;/code&gt; status code we can start the actual test. Remember our configuration on &lt;code&gt;transaction_replay.json&lt;/code&gt;, we set &lt;code&gt;iteration_count&lt;/code&gt; to 1000 since we have 1000 lines of data in our CSV. Instead of &lt;code&gt;incremental&lt;/code&gt;, we will use &lt;code&gt;waved&lt;/code&gt; load type to simulate more realistic network traffic.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If the &lt;code&gt;iteration_count&lt;/code&gt; is greater than the data count on the CSV file, then Ddosify Engine loops over the file .&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Waved load type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TiKMOac---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/ddosify/ddosify/master/assets/waved.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TiKMOac---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/ddosify/ddosify/master/assets/waved.gif" alt="Ddosify linear load type" width="600" height="411"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ddosify -config transaction_replay.json

&amp;lt;.. truncated ..&amp;gt;

RESULT
-------------------------------------
Success Count:    1000  (100%)
Failed Count:     0     (0%)

Durations (Avg):
  DNS                  :0.0037s
  Connection           :0.0015s
  Request Write        :0.0000s
  Server Processing    :0.0831s
  Response Read        :0.0000s
  Total                :0.0886s

Status Code (Message) :Count
  200 (OK)           :1000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result shows that our backend API can handle 1000 exchange transactions in 60 seconds in the waved load type. We can test the system under different conditions by changing &lt;code&gt;duration&lt;/code&gt;, &lt;code&gt;load_type&lt;/code&gt;, and &lt;code&gt;iteration_count&lt;/code&gt; parameters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;At first, we showed how to use &lt;code&gt;rand()&lt;/code&gt; utility method of Ddosify Engine to use environment variables in advance. Then we demonstrated the usage of Test Data import via CSV file along with a traffic replay scenario.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ddosify/ddosify/"&gt;Ddosify Engine&lt;/a&gt; has more capabilities on each release, follow it on GitHub to stay updated.&lt;/p&gt;

&lt;p&gt;You can find the files we used in this article at &lt;a href="https://github.com/ddosify/blog_examples/tree/main/004_csv_import_blog"&gt;Ddosify Blog Examples&lt;/a&gt; repository. If you need assistance, you can join our &lt;a href="https://discord.gg/9KdnrSUZQg"&gt;Discord channel&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>api</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Testing the Performance of User Authentication Flow</title>
      <dc:creator>Kürşat Aktaş</dc:creator>
      <pubDate>Sat, 14 Jan 2023 12:56:06 +0000</pubDate>
      <link>https://dev.to/kursataktas/testing-the-performance-of-user-authentication-flow-41p3</link>
      <guid>https://dev.to/kursataktas/testing-the-performance-of-user-authentication-flow-41p3</guid>
      <description>&lt;p&gt;Testing the performance of the backend API on high traffic is a must-have step before deploying it to production. We have to simulate the traffic as realistically as possible. This includes testing the endpoints that require authentication. In this article, we explained how to simulate hundreds of users that first get their JWT token from the Login endpoint and hits the private endpoints. We have used &lt;a href="https://github.com/ddosify/ddosify"&gt;Ddosify Open Source Load Engine&lt;/a&gt;, so we didn't need to write any line of code.&lt;/p&gt;

&lt;p&gt;Happy reading&lt;br&gt;
&lt;a href="https://ddosify.com/blog/testing-the-performance-of-user-authentication-flow"&gt;Testing the Performance of User Authentication Flow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>performance</category>
      <category>devops</category>
      <category>api</category>
    </item>
  </channel>
</rss>
