SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
Introduction of K6
Presented by : Soniya Raichandani
QA Consultant
KnolX Etiquettes
Punctuality
Respect Knolx session timings,
you are requested not to join
sessions after a 5 minutes
threshold post the session start
time.
Feedback
Make sure to submit a
constructive feedback for all
sessions as it is very helpful for
the presenter.
Mute
Please keep your window on
mute.
Avoid Disturbance
Avoid leaving your window
unmuted after asking a question
What is Performance testing?
What is K6?
Why k6?
➤
➤
➤
Agenda
CI/CD in K6
➤
➤ Demo
● It is a non-functional software testing technique that determines the
stability,speed, and scalability of an application.
PERFORMANCE TESTING
● In Performance testing,we evaluating the Application
output,Speed,Velocity, Network bandwidth,maximum concurrent
users, common response time etc.
Normal and expected
load
Higher than expected
load
Sudden increase load
Huge volume of
load
Monitor database
load
Different Types Of Performance Testing
What is ?
● k6 is an open-source load testing tool for testing the performance of APIs,
microservices, and websites.
● This tool is scriptable and support the Javascript language.
● k6 was initially released on GitHub in 2017 by Load Impact as an
open-source.
● It’s written in Go Language.
K6
Load Testing in K6
Load Testing is primarily concerned with assessing the current
performance of your system in terms of concurrent users or
requests per second.
● Options
● Checks & Thresholds
● Modules
● Metrics
● Groups & Tags
Components:-
Checks
Checks
VUs Duration Stages
A fixed number of
VUs execute as
many iterations as
possible for a
specified amount of
time.
A string specifying
the total duration a
test run should be
run for.
Array of objects that
specify the target
number of VUs to
ramp up or down to.
Options in K6
● Checks are asserts, but differ in that they don't halt the execution. Instead, they store the result of
the check, pass or fail, and let the script execution continue.
● Checks are great for codifying assertions relating to HTTP requests/responses, such as making
sure the response code is an HTTP.
CHECKS
● In the script,need to import the check -’import {check} from K6’
Syntax:-
check(res,{
'is status 200': (r) => r.status === 200,
});
Threshold
● Thresholds are a pass/fail criteria used to specify the performance expectations
of the system under test.
● Thresholds analyze the performance metrics and determine the final test result
(pass/fail).
export const thres = {
thresholds: {
http_req_failed: ['rate<0.01'], // http errors should be less than 1%
http_req_duration: ['p(95)<200'], // 95% of requests should be below 200ms
},
};
Syntax:-
Modules
While writing test scripts, it's common to import different
modules, or part of modules, for usage throughout the script. In
k6, it is possible to import three different kinds of modules:
● Built-in modules
● Local filesystem modules
● Remote HTTP(S) modules
Metrics
Build-In Metrics
D
Build- In
Custom
Metrics
A metric that allows for calculating statistics on the added values
(min, max, average and percentiles).
Custom
Metrics
Counter
Gauge
Rate
Trend
Groups & Tags
Groups:- Groups are optional, and it allows you to “group” a large
load script to help you with the test result analysis. Groups can be
nested, allowing you the BDD-style of testing.
Tags:- Tags are a simple and powerful way to categorize your k6
entities for later results filtering.
Speed Maintenance
Support of
test code Reports
Language Recording
Protocol VCS
K6
Why K6?
CI/CD in K6
In k6,it is possible to integrate with CI/CD tools with the help of Github actions because github
actions has own advantages.To integrate k6 with GitHub action we need k6 based test script.
Integration K6 with Github Actions
GitHub actions more powerful and most effortless CI/CD tools among which we have
earlier tools like Jenkins, etc.
Demo
Introduction to K6
Introduction to K6

Mais conteúdo relacionado

Mais procurados

Advanced Load Runner
Advanced Load RunnerAdvanced Load Runner
Advanced Load Runner
telab
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
Atul Pant
 

Mais procurados (20)

Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
Performance Testing using LoadRunner - Kamran Khan [chromeis.com]
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
Advanced Load Runner
Advanced Load RunnerAdvanced Load Runner
Advanced Load Runner
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
Writing Test Cases in Agile
Writing Test Cases in AgileWriting Test Cases in Agile
Writing Test Cases in Agile
 
Playwright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern WebPlaywright: A New Test Automation Framework for the Modern Web
Playwright: A New Test Automation Framework for the Modern Web
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
Postman
PostmanPostman
Postman
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Qa process 2012
Qa process 2012Qa process 2012
Qa process 2012
 
Continuous Quality with Postman
Continuous Quality with PostmanContinuous Quality with Postman
Continuous Quality with Postman
 
gRPC Design and Implementation
gRPC Design and ImplementationgRPC Design and Implementation
gRPC Design and Implementation
 
Securing Kafka
Securing Kafka Securing Kafka
Securing Kafka
 
Gatling overview
Gatling overviewGatling overview
Gatling overview
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
Grafana
GrafanaGrafana
Grafana
 

Semelhante a Introduction to K6

Goutham_2+_Testing.docx
Goutham_2+_Testing.docxGoutham_2+_Testing.docx
Goutham_2+_Testing.docx
goutham mylu
 

Semelhante a Introduction to K6 (20)

Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
Amardeep qa test_automation_cv
Amardeep qa test_automation_cvAmardeep qa test_automation_cv
Amardeep qa test_automation_cv
 
Amardeep qa test_automation_cv
Amardeep qa test_automation_cvAmardeep qa test_automation_cv
Amardeep qa test_automation_cv
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
Laravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and ToolsLaravel Load Testing: Strategies and Tools
Laravel Load Testing: Strategies and Tools
 
Modern Testing Strategies for Evolving Ecosystems
Modern Testing Strategies for Evolving EcosystemsModern Testing Strategies for Evolving Ecosystems
Modern Testing Strategies for Evolving Ecosystems
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Cypress Best Pratices for Test Automation
Cypress Best Pratices for Test AutomationCypress Best Pratices for Test Automation
Cypress Best Pratices for Test Automation
 
Goutham_2+_Testing.docx
Goutham_2+_Testing.docxGoutham_2+_Testing.docx
Goutham_2+_Testing.docx
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Gajanan Bhat
Gajanan BhatGajanan Bhat
Gajanan Bhat
 
Accelerating tests with Cypress for a leaderboard platform
Accelerating tests with Cypress for a leaderboard platformAccelerating tests with Cypress for a leaderboard platform
Accelerating tests with Cypress for a leaderboard platform
 
Indy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-mule
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
ChandraPrabhaSR_Resume
ChandraPrabhaSR_ResumeChandraPrabhaSR_Resume
ChandraPrabhaSR_Resume
 
Vijay_Teekinavar_Kallesh
Vijay_Teekinavar_KalleshVijay_Teekinavar_Kallesh
Vijay_Teekinavar_Kallesh
 
End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020
 
Project P Open Workshop
Project P Open WorkshopProject P Open Workshop
Project P Open Workshop
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 

Mais de Knoldus Inc.

Mais de Knoldus Inc. (20)

Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptx
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Introduction to K6

  • 1. Introduction of K6 Presented by : Soniya Raichandani QA Consultant
  • 2. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Mute Please keep your window on mute. Avoid Disturbance Avoid leaving your window unmuted after asking a question
  • 3. What is Performance testing? What is K6? Why k6? ➤ ➤ ➤ Agenda CI/CD in K6 ➤ ➤ Demo
  • 4. ● It is a non-functional software testing technique that determines the stability,speed, and scalability of an application. PERFORMANCE TESTING ● In Performance testing,we evaluating the Application output,Speed,Velocity, Network bandwidth,maximum concurrent users, common response time etc.
  • 5. Normal and expected load Higher than expected load Sudden increase load Huge volume of load Monitor database load Different Types Of Performance Testing
  • 7. ● k6 is an open-source load testing tool for testing the performance of APIs, microservices, and websites. ● This tool is scriptable and support the Javascript language. ● k6 was initially released on GitHub in 2017 by Load Impact as an open-source. ● It’s written in Go Language. K6
  • 8. Load Testing in K6 Load Testing is primarily concerned with assessing the current performance of your system in terms of concurrent users or requests per second. ● Options ● Checks & Thresholds ● Modules ● Metrics ● Groups & Tags Components:-
  • 9. Checks Checks VUs Duration Stages A fixed number of VUs execute as many iterations as possible for a specified amount of time. A string specifying the total duration a test run should be run for. Array of objects that specify the target number of VUs to ramp up or down to. Options in K6
  • 10. ● Checks are asserts, but differ in that they don't halt the execution. Instead, they store the result of the check, pass or fail, and let the script execution continue. ● Checks are great for codifying assertions relating to HTTP requests/responses, such as making sure the response code is an HTTP. CHECKS ● In the script,need to import the check -’import {check} from K6’ Syntax:- check(res,{ 'is status 200': (r) => r.status === 200, });
  • 11. Threshold ● Thresholds are a pass/fail criteria used to specify the performance expectations of the system under test. ● Thresholds analyze the performance metrics and determine the final test result (pass/fail). export const thres = { thresholds: { http_req_failed: ['rate<0.01'], // http errors should be less than 1% http_req_duration: ['p(95)<200'], // 95% of requests should be below 200ms }, }; Syntax:-
  • 12. Modules While writing test scripts, it's common to import different modules, or part of modules, for usage throughout the script. In k6, it is possible to import three different kinds of modules: ● Built-in modules ● Local filesystem modules ● Remote HTTP(S) modules
  • 13. Metrics Build-In Metrics D Build- In Custom Metrics A metric that allows for calculating statistics on the added values (min, max, average and percentiles). Custom Metrics Counter Gauge Rate Trend
  • 14. Groups & Tags Groups:- Groups are optional, and it allows you to “group” a large load script to help you with the test result analysis. Groups can be nested, allowing you the BDD-style of testing. Tags:- Tags are a simple and powerful way to categorize your k6 entities for later results filtering.
  • 15. Speed Maintenance Support of test code Reports Language Recording Protocol VCS K6 Why K6?
  • 16.
  • 17. CI/CD in K6 In k6,it is possible to integrate with CI/CD tools with the help of Github actions because github actions has own advantages.To integrate k6 with GitHub action we need k6 based test script. Integration K6 with Github Actions GitHub actions more powerful and most effortless CI/CD tools among which we have earlier tools like Jenkins, etc.
  • 18. Demo