Learn Software Performance Testing with K6 :: Part-7
গত পর্বে আমরা দেখেছিলাম কিভাবে ENV variable and CSV এর মাধ্যমে কিভাবে ভেলু পাস করা যায়। তাছাড়া ইউজার লগিন এর টোকেন কিভাবে অন্য API এর header এর authorization হিসেবে সেট করা যায়। আজকে আমরা দেখব performance testing করার সময় Grafana and Influxdb use করে কিভাবে real time monitoring করা যায়। তো চলুন শুরু করা যাক।
Influxdb এর ৩ টি version আছে।
1. InfluxDB 1.x (Legacy)
2. InfluxDB 2.x
3. InfluxDB 3.x (Latest)
প্রাথমিক ধারণা লাভ এবং installation এর ঝামেলা এড়ানোর জন্য আমরা Influxdb v1.x version টাই install করব।
Installation Process:
Download Influxdb:
wget https://download.influxdata.com/influxdb/releases/influxdb-1.11.8-windows-amd64.zip -UseBasicParsing -OutFile influxdb-1.11.8_windows_amd64.zip
Extract Zip:
Expand-Archive .\influxdb-1.11.8-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\influxdb\'
2. Now Edit system variable and add following path: C:\Program Files\InfluxData\influxdb\
3. Now hit the command to start influxdb server >influx
4. Navigate to http://localhost:8086 to make sure the influxdb server is running
Now write a basic script to see the output in influxdb:
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
iterations:50,
vus:2
};
export default function () {
http.get('https://test-api.k6.io');
// Sleep for 1 second to simulate real-world usage
sleep(1);
}
Hit following command to write data in k6 database:
k6 run --out influxdb=http://localhost:8086/k6 first-script.js
Now again go to your terminal and enter into influxddb by hitting those commands:
> influx
> USE K6
> SHOW MEASUREMENTS
It will show the list of measurement data inserted in k6
এখন আমরা Grafana install করব।
Install Grafana:
You are successfully configured the influxdb with Grafana now!
Run k6 for real time monitoring in Grafana
Now hit the following command again for real time monitoring:k6 run --out influxdb=http://localhost:8086/k6 first-script.js
Finally আমরা Real time monitoring ও করে ফেললাম।
Good Luck! Happy performance testing :)
Could you please check your dm