Skip to contentমূল লেখায় যান

Topic 04 · K6টপিক 04 · K6

What Is k6?

An open-source load testing tool where you write the test as JavaScript.

5 min read5 মিনিটে পড়া যায় · 6 sections6টি সেকশন · 8 sources8টি সোর্স · updated Nov 2026আপডেট: Nov 2026

One JavaScript file, run by k6একটা JavaScript ফাইল, k6 দিয়ে চালানো

See a short script run inside k6, then try three imports to learn why k6 is not Node.js.একটা ছোট স্ক্রিপ্ট k6-এর ভেতরে চলতে দেখুন, তারপর তিনটা ইমপোর্ট চেষ্টা করে দেখুন কেন k6 Node.js নয়।

2 min2 মিনিট7 steps7টি ধাপ
  • Script filesস্ক্রিপ্ট ফাইল1
  • Requests sentপাঠানো অনুরোধ0
script.jsscript.js1 short file1টা ছোট ফাইলk6k6engineইঞ্জিনQuickPizzaQuickPizzademo siteডেমো সাইট

You’ll learnআপনি শিখবেন

  • What a k6 test file looks likek6 টেস্ট ফাইল দেখতে কেমন✓
  • Why k6 is JavaScript but not Node.jsk6 কেন JavaScript, কিন্তু Node.js নয়
  • Which protocols work out of the boxকোন প্রোটোকল আলাদা কিছু ছাড়াই চলে
  • What a threshold does to a testthreshold টেস্টের কী করে
  • Why InfluxDB v2 needs an extensionInfluxDB v2-এ কেন extension লাগে

What k6 is

k6 is an open-source tool for performance testing. It is easy for developers to use, and you can extend it Source 1সোর্স 1. Developers, QA engineers, SDETs, and SREs use it Source 1সোর্স 1. The k6 project describes it as a modern load-testing tool, and its key design goal is the best developer experience Source 2সোর্স 2.

Its scripts are JavaScript, and k6 runs them in an embedded JavaScript engine. The project says this gives the performance of Go with the scripting familiarity of JavaScript Source 2সোর্স 2. The tool is optimized for minimal resource consumption, so it suits high-load tests such as spike, stress, and soak tests Source 1সোর্স 1.

The license is AGPL-3.0 Source 2সোর্স 2. The docs call it Grafana k6 Source 1সোর্স 1.

A test is a short file. This script sends one request to the QuickPizza demo site:

import http from 'k6/http';

export default function () {
  http.get('https://quickpizza.grafana.com');
}

The next page installs k6 and runs a full script.

সহজ English

k6 is an open-source tool that tests how an app behaves under load Source 1সোর্স 1. Developers, testers, and site reliability engineers (SREs) use it Source 1সোর্স 1. The project says its main goal is the best developer experience Source 2সোর্স 2.

You write your tests in JavaScript, and k6 runs them in a JavaScript engine built into it. The project says this gives the performance of Go with the scripting familiarity of JavaScript Source 2সোর্স 2. k6 uses few resources, so it suits big tests such as spike, stress, and soak tests Source 1সোর্স 1.

The license is AGPL-3.0 Source 2সোর্স 2. The docs call it Grafana k6 Source 1সোর্স 1.

A test is a short file. This script sends one request to the QuickPizza demo site:

import http from 'k6/http';

export default function () {
  http.get('https://quickpizza.grafana.com');
}

The next page installs k6 and runs a full script.

বাংলা ব্যাখ্যা

k6 একটা open-source performance testing টুল। এটা developer-দের জন্য সহজ, আর আপনি এটা extend করতে পারেন Source 1সোর্স 1। Developer, QA engineer, SDET এবং SRE-রা এটা ব্যবহার করেন Source 1সোর্স 1। প্রজেক্টের মূল লক্ষ্য হলো সেরা developer experience দেওয়া Source 2সোর্স 2।

এর স্ক্রিপ্ট JavaScript-এ লেখা হয়, আর k6 সেটা নিজের ভেতরের একটা embedded JavaScript engine-এ চালায়। প্রজেক্ট বলে, এতে Go-এর performance আর JavaScript-এর পরিচিত scripting একসাথে পাওয়া যায় Source 2সোর্স 2। টুলটা কম রিসোর্স ব্যবহার করে, তাই spike, stress এবং soak টেস্টের মতো বড় লোড টেস্টে এটা কাজে লাগে Source 1সোর্স 1।

লাইসেন্স AGPL-3.0 Source 2সোর্স 2। Docs-এ এর নাম Grafana k6 Source 1সোর্স 1।

একটা টেস্ট হলো ছোট একটা ফাইল। এই স্ক্রিপ্ট QuickPizza ডেমো সাইটে একটা রিকোয়েস্ট পাঠায়:

import http from 'k6/http';

export default function () {
  http.get('https://quickpizza.grafana.com');
}

পরের পেজে আপনি k6 install করবেন এবং পুরো একটা স্ক্রিপ্ট চালাবেন।

JavaScript, but not Node.js

The owner's notes say that people who know JavaScript or Node.js learn k6 easily. The first part is right. The second part needs a correction. k6 is not Node.js and it is not a browser Source 4সোর্স 4.

This has 3 effects Source 4সোর্স 4:

  • Packages that need Node.js APIs, such as the os and fs modules, do not work in k6.
  • k6 resolves modules like a browser. You write the full file name, for example ./helpers.js. It does not use Node.js module resolution.
  • To use npm packages, you build your script with a bundler first.

Your script imports k6 modules, such as k6/http. These modules come with k6 Source 4সোর্স 4.

সহজ English

People who know JavaScript or Node.js learn k6 fast. This is true for the JavaScript part. But k6 is not Node.js. It is not a browser Source 4সোর্স 4.

This has 3 effects Source 4সোর্স 4:

  • A package that needs Node.js features, such as the os and fs modules, does not work in k6.
  • k6 finds files like a browser. You write the full file name, for example ./helpers.js.
  • To use npm packages, you build your script with a bundler first.

Your script imports k6 modules, such as k6/http. These modules come with k6 Source 4সোর্স 4.

বাংলা ব্যাখ্যা

Owner-এর notes বলে, যাঁরা JavaScript বা Node.js জানেন তাঁরা k6 সহজে শেখেন। JavaScript অংশটা ঠিক। কিন্তু k6 Node.js নয়, এটা browser-ও নয় Source 4সোর্স 4।

এর তিনটা ফল আছে Source 4সোর্স 4:

  • যে package-এ Node.js API লাগে, যেমন os এবং fs module, সেটা k6-এ কাজ করে না।
  • k6 browser-এর মতো ফাইল খুঁজে নেয়। আপনাকে পুরো ফাইলের নাম লিখতে হয়, যেমন ./helpers.js।
  • npm package ব্যবহার করতে হলে আগে bundler দিয়ে স্ক্রিপ্ট build করতে হয়।

আপনার স্ক্রিপ্ট k6 module import করে, যেমন k6/http। এই module k6-এর সাথেই আসে Source 4সোর্স 4।

Why teams choose k6

The owner's notes give 10 reasons. This section keeps them and checks each one against the docs. Two points changed.

#ReasonWhat the sources say
1JavaScript basedTests are JavaScript, but k6 does not run on Node.js Source 2সোর্স 2 Source 4সোর্স 4.
2Light and fastk6 is optimized for minimal resource consumption Source 1সোর্স 1. It combines the performance of Go with JavaScript scripting Source 2সোর্স 2.
3Scriptable, fits automationk6 integrates with CI/CD and automation tools Source 1সোর্স 1.
4Thresholds and checksA threshold is a pass or fail rule on a metric. If it fails, the test ends with a failed status Source 6সোর্স 6. A check does not fail the test by itself. k6 tracks the rate of failed checks Source 7সোর্স 7.
5InfluxDB and Grafanak6 has built-in output for InfluxDB v1 only. For InfluxDB v2 you build k6 with an extension Source 5সোর্স 5.
6Many protocolsHTTP/1.1, HTTP/2, WebSockets, and gRPC work out of the box Source 3সোর্স 3. The k6 browser API runs browser tests Source 1সোর্স 1. Extensions add more Source 3সোর্স 3.
7Reusable, version controlledTests are code: you reuse scripts, modularize logic, and keep them in version control Source 2সোর্স 2.
8Developer-friendly APIThe scripting API is full-featured Source 2সোর্স 2.
9Local and cloudYou run scripts on the CLI, in CI, or across a Kubernetes cluster Source 2সোর্স 2. Grafana Cloud k6 runs k6 OSS capabilities in the cloud Source 1সোর্স 1.
10Open source, communityThe code is open under AGPL-3.0, and the project takes contributions on GitHub Source 2সোর্স 2.

সহজ English

The owner's notes give 10 reasons. Here they are, checked against the docs. Two points changed.

#ReasonWhat the sources say
1JavaScript basedTests are JavaScript, but k6 does not run on Node.js Source 2সোর্স 2 Source 4সোর্স 4.
2Light and fastk6 uses few resources Source 1সোর্স 1. It combines the speed of Go with JavaScript scripting Source 2সোর্স 2.
3Scriptable, fits automationk6 works with CI/CD and automation tools Source 1সোর্স 1.
4Thresholds and checksA threshold is a pass or fail rule on a metric. If it fails, the test fails Source 6সোর্স 6. A check does not fail the test by itself Source 7সোর্স 7.
5InfluxDB and Grafanak6 has built-in output for InfluxDB v1 only. For InfluxDB v2 you build k6 with an extension Source 5সোর্স 5.
6Many protocolsHTTP/1.1, HTTP/2, WebSockets, and gRPC work out of the box Source 3সোর্স 3. The k6 browser API runs browser tests Source 1সোর্স 1. Extensions add more Source 3সোর্স 3.
7Reusable, version controlledTests are code. You reuse scripts and keep them in version control Source 2সোর্স 2.
8Developer-friendly APIThe scripting API is full-featured Source 2সোর্স 2.
9Local and cloudYou run scripts on the CLI, in CI, or across a Kubernetes cluster Source 2সোর্স 2. Grafana Cloud k6 runs them in the cloud Source 1সোর্স 1.
10Open source, communityThe code is open under AGPL-3.0. The project takes contributions on GitHub Source 2সোর্স 2.

বাংলা ব্যাখ্যা

Owner-এর notes-এ ১০টা কারণ আছে। এখানে সেগুলো docs-এর সাথে মিলিয়ে দেখা হয়েছে। দুটো পয়েন্ট বদলেছে।

#কারণসোর্স কী বলে
1JavaScript basedটেস্ট JavaScript-এ লেখা হয়, কিন্তু k6 Node.js-এ চলে না Source 2সোর্স 2 Source 4সোর্স 4।
2হালকা ও দ্রুতk6 কম রিসোর্স ব্যবহার করে Source 1সোর্স 1। এতে Go-এর performance আর JavaScript scripting একসাথে আছে Source 2সোর্স 2।
3Scriptable, automation-friendlyk6 CI/CD ও automation টুলের সাথে কাজ করে Source 1সোর্স 1।
4Threshold ও checkThreshold হলো একটা metric-এর pass বা fail নিয়ম। সেটা fail করলে পুরো টেস্ট fail হয় Source 6সোর্স 6। Check নিজে টেস্ট fail করে না Source 7সোর্স 7।
5InfluxDB ও Grafanak6-এর built-in output শুধু InfluxDB v1-এর জন্য। InfluxDB v2-এর জন্য extension দিয়ে k6 build করতে হয় Source 5সোর্স 5।
6অনেক protocolHTTP/1.1, HTTP/2, WebSockets এবং gRPC আলাদা কিছু ছাড়াই চলে Source 3সোর্স 3। k6 browser API দিয়ে browser টেস্ট চালানো যায় Source 1সোর্স 1। Extension আরও protocol যোগ করে Source 3সোর্স 3।
7Reusable, version controlledটেস্ট হলো কোড। আপনি স্ক্রিপ্ট reuse করেন এবং version control-এ রাখেন Source 2সোর্স 2।
8Developer-friendly APIScripting API পূর্ণাঙ্গ (full-featured) Source 2সোর্স 2।
9Local ও cloudস্ক্রিপ্ট CLI-তে, CI-তে বা Kubernetes cluster-এ চালানো যায় Source 2সোর্স 2। Grafana Cloud k6 সেটা ক্লাউডে চালায় Source 1সোর্স 1।
10Open source, communityকোড AGPL-3.0 লাইসেন্সে খোলা। প্রজেক্ট GitHub-এ contribution নেয় Source 2সোর্স 2।

The Two Changes Explained

The two changes. The first two changes are in rows 4 and 5. A failed threshold fails the test, and it does not only notify you. The InfluxDB output is built in for v1 only. The command for v1 is k6 run --out influxdb=http://localhost:8086/k6 script.js Source 5সোর্স 5.

The owner's own view. A team that already works in a JavaScript stack avoids a second tool chain with k6. This is the tutorial's own experience and not a claim from the docs.

সহজ English

The two changes are in rows 4 and 5. A failed threshold fails the test. It does not only notify you. The built-in InfluxDB output is for v1 only. The command for v1 is k6 run --out influxdb=http://localhost:8086/k6 script.js Source 5সোর্স 5.

The owner's own view: a team that already works in a JavaScript stack avoids a second tool chain with k6. This is the tutorial's own experience and not a claim from the docs.

বাংলা ব্যাখ্যা

বদলগুলো ৪ ও ৫ নম্বর সারিতে। Threshold fail করলে টেস্ট fail হয়, শুধু notify করে না। Built-in InfluxDB output শুধু v1-এর জন্য। v1-এর কমান্ড হলো k6 run --out influxdb=http://localhost:8086/k6 script.js Source 5সোর্স 5।

Owner-এর নিজের মত: যে টিম আগে থেকেই JavaScript stack-এ কাজ করে, k6 দিয়ে তাকে দ্বিতীয় একটা tool chain নিতে হয় না। এটা টিউটোরিয়ালের নিজের অভিজ্ঞতা, docs-এর দাবি নয়।

What k6 can test and how you extend it

Out of the box, k6 supports HTTP/1.1, HTTP/2, WebSockets, and gRPC Source 3সোর্স 3. By default k6 starts with HTTP/1.1. If the server supports HTTP/2, k6 upgrades the connection by itself Source 3সোর্স 3.

The k6 browser API runs browser-based performance tests and collects browser metrics Source 1সোর্স 1.

Extensions add features that the core does not have. k6 has 4 types of extensions: JavaScript, output, secret source, and subcommand Source 8সোর্স 8. Community extensions add protocols such as SQL, Kafka, ZeroMQ, and Redis. You build a k6 binary with them using the xk6 tool Source 3সোর্স 3.

If you do not want to write code, k6 Studio is a desktop app that makes scripts for you Source 2সোর্স 2.

সহজ English

k6 can test these kinds of traffic out of the box: HTTP/1.1, HTTP/2, WebSockets, and gRPC Source 3সোর্স 3. It starts with HTTP/1.1. If the server supports HTTP/2, k6 switches to it by itself Source 3সোর্স 3.

The k6 browser API runs performance tests in a browser. It also collects browser metrics Source 1সোর্স 1.

Extensions add features that the core does not have. k6 has 4 types: JavaScript, output, secret source, and subcommand Source 8সোর্স 8.

Community extensions add more protocols, such as SQL, Kafka, ZeroMQ, and Redis. You use the xk6 tool to build a k6 binary that includes them Source 3সোর্স 3.

If you do not want to write code, use k6 Studio. It is a desktop app that makes scripts for you Source 2সোর্স 2.

বাংলা ব্যাখ্যা

k6 আলাদা কিছু ছাড়াই HTTP/1.1, HTTP/2, WebSockets এবং gRPC সাপোর্ট করে Source 3সোর্স 3। k6 ডিফল্টভাবে HTTP/1.1 দিয়ে শুরু করে। সার্ভার HTTP/2 সাপোর্ট করলে k6 নিজেই কানেকশন upgrade করে নেয় Source 3সোর্স 3।

k6 browser API দিয়ে browser-ভিত্তিক performance টেস্ট চালানো যায় এবং browser metric নেওয়া যায় Source 1সোর্স 1।

Extension এমন ফিচার যোগ করে যা core-এ নেই। k6-এর extension ৪ রকম: JavaScript, output, secret source এবং subcommand Source 8সোর্স 8। Community extension SQL, Kafka, ZeroMQ এবং Redis-এর মতো protocol যোগ করে। এগুলো দিয়ে xk6 টুলে k6 binary build করতে হয় Source 3সোর্স 3।

কোড লিখতে না চাইলে k6 Studio একটা desktop অ্যাপ, যা আপনার জন্য স্ক্রিপ্ট বানিয়ে দেয় Source 2সোর্স 2।

Key words

TermMeaning
k6An open-source performance testing tool, with tests in JavaScript Source 1সোর্স 1 Source 2সোর্স 2.
Embedded JavaScript engineThe engine inside k6 that runs your script. It is not Node.js Source 2সোর্স 2 Source 4সোর্স 4.
ThresholdA pass or fail rule on a metric. A failed threshold fails the test Source 6সোর্স 6.
CheckA true or false test on a response. A failed check does not fail the test Source 7সোর্স 7.
ExtensionCode that adds a feature to k6, such as a protocol or an output Source 8সোর্স 8.
xk6The tool that builds a k6 binary with extensions Source 3সোর্স 3.
Grafana Cloud k6A cloud service that uses the k6 OSS capabilities Source 1সোর্স 1.
  1. [1]
    Grafana k6 (documentation overview)

    Grafana Labs · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  2. [2]
    grafana/k6 (README)

    GitHub · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  3. [3]
    Protocols

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  4. [4]
    Modules

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  5. [5]
    InfluxDB output

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  6. [6]
    Thresholds

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  7. [7]
    Checks

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27

  8. [8]
    Extensions

    Grafana k6 documentation · accessed 2026-10-27দেখা হয়েছে: 2026-10-27