SlideShare a Scribd company logo
1 of 67
Download to read offline
@gmuecke
Functional Load Testing
GERALD MÜCKE
JAVALAND 2018
𝑓 𝑥 =
1
𝜎 2𝜋
𝑒
−
1
2
𝑥−𝜇
𝜎
2
𝐵 𝑘 𝑝, 𝑛 =
𝑛
𝑘
𝑝 𝑘
1 − 𝑝 𝑛−𝑘
𝑃 𝜆 𝑘 =
𝜆 𝑘
𝑘!
𝑒−𝜆
2
@gmuecke
This talk is not about
 Load Testing a Function
 Loading a Function Test
 Loading a Test Function
 Testing a Load Function
 Test Loading a Function
 Testing a Function Load
It’s about using Functions to conduct Load Testing
4
@gmuecke
This Photo by Unknown Author is licensed under CC BY-SA
This Photo by Unknown Author is licensed under CC BY-SA
Siméon Denis Poisson
5
Jakob I. Bernoulli
This Photo by Unknown Author is licensed under CC BY-SA
Carl Friedrich Gauss
@gmuecke
What is Testing?
 “Software testing is a process of executing a program or application
with the intent of finding the software bugs.” (ISTQB)
 Testing is a information-providing service,
not a "quality assurance" function.
 The value of testing is determined by whether it provides useful and
timely information.
 A tester is a customer advocate.
6
@gmuecke
"Dieses Foto" von Unbekannter Autor ist lizenziert gemäß CC BY
Context is
everything
 The value of any
practice depends on
its context.
 There are good
practices in context,
but there are no best
practices.
(From Seven Principles of Context Driven Testing)
7
@gmuecke
How to do Performance Testing?
8
@gmuecke
Type of Load Test
Batch Online
9
• Process the most events in the
least time
• Event Driven
• Focus on Low Response Times
• Get the most done in the least time
and resources
• Data Driven
• Focus on Maximum Troughput
@gmuecke
Input to Load Test Scenarios
 Performance Requirements
 Target Users (Concurrent, per Duration, Total)
 Response Time Targets (90%, 95%, 99%)
 Throughput
 Historical Data
 Number of Total Users per Duration
 Number of Concurrent Users
 Peak Loads (Peak Month/Day/Hour/Minute)
 Request Logs
 Educated Guesses / Gut Feeling
10
@gmuecke
Example
Requirements
 The system is capable of
 Serving 1000 concurrent users with
an average Response Time of 1.5s
 Source: The Project Manager
 What are the most relevant
information?
This Photo by Unknown Author is licensed under CC BY-NC-SA
11
@gmuecke
Numbers need a Context
 Concurrent Users (CPU)
 vs. Concurrent Sessions (Memory)
 vs. Users per Period (Capacity)
 Average
 vs. perceived Average (90 %)
 vs. Percentiles (95%,99%,99.9%)
 1000 Conc.Users, avg < 1.5s
 vs 1000 Users/h, 90% < 1.5s
This Photo by Unknown Author is licensed under CC BY-NC-SA
12
@gmuecke
Load Testing Practices
 Soak Testing
 Discover Leaks
 SLA Regressions
 Stress Testing
 Testing Stability
 Overload / Recovery
 Benchmarking
 Discover Regressions between different Versions or Configurations
13
@gmuecke
A typical load test: Constant Load
 Constant Load
 + Ramp up / down
 Allowing the System to adapt to Load (warm up)
 Distributes Load (virtual users)
 Good for:
 Finding latent bugs, i.e.Memory or Resource Leaks
 Precise Measurements
 Regressions
 Stability Issues
 Statistical Response Times
 Known Load Distributions
Load
%
t
14
@gmuecke
Why do a ramp up?
 System Warm-up
 Allow JIT to optimize code
 Allow Caches to be populated
 Fetch or Initiate Resources (i.e. Database
Connections)
 Allow Queues and Buffers to fill to a stable level
 Distribute Load evenly
 System’s Performance Characteristics are
non-linear during ramup
15
This Photo by Unknown Author is licensed under CC BY-NC-ND
@gmuecke
But, from the user perspective …
This Photo by Unknown Author is licensed under CC BY-NC-ND
17
@gmuecke
What is the
user value
of…
 My car consumes 4.8 l
per 100 km in the
benchmark test
 Yet in the City,
I constantly use more
than 6.5 l per 100 km
18
@gmuecke
What is the user
value of…
 98% of all trains are on time
 Yet, I miss 1 in 10 connecting trains
with a connection time of 3 mins
 Yet, I miss all connecting trains
during peak hours (adding 30mins)
19
@gmuecke
What is the
use value
of…
 With my car
I can drive faster than
200 km/h
 Yet, I’m stuck in
traffic jams due to
road work adding a
third lane
20
@gmuecke
The context of measurement 21
"Dieses Foto" von Unbekannter Autor ist lizenziert gemäß CC BY-SA
Scope for
Static Load
Test
Scope for User Experience
"Dieses Foto" von Unbekannter Autor ist lizenziert gemäß
CC BY-NC
A Typical simplification of
the system’s users
@gmuecke
Today’s Challenges
23
@gmuecke
Real Life Scenarios
 Singular Events
 Launch of Marketing
Campaign / Black Friday Sales
 Launch of new Service or
WebSite
 Users Logging in in the
morning
 Clients connect to a system
on schedule
 Automated Updates
 Daily Patterns
 “McDonalds” M
 asymmetric-M
24
@gmuecke
The Challenges
 Dynamic Capacity
 Systems automatically scale up or down
 Systems are Virtualized (especially in the Cloud)
 Users come in Masses
 A lot of people are online today
 Social Media as Amplifier
 Viral Marketing
27
@gmuecke
The information we need
 How are users affected during scaling
 How are the Response Times (with regard to SLAs)
 During unexpected loads
 During typical usage (which is not constant)
 In order to design a dynamic system that
 Is cost-efficient (as small as possible during normal loads)
 Can deal with (unexpected) peak loads
 Fulfills the SLAs (Reliability, Response Times, Throughput, …)
28
@gmuecke
Three
elements of
a Load Test
• How groups of users
navigate through
your application
User
Flows
• How to fetch a
typical page and it’s
resources
Page
Scripts
• How the users arrive
at your page
Load
Function
29
@gmuecke
Three
elements of
a Load Test
User
Flows
Page
Scripts
Load
Function
30
GET /index.html
GET /favicon.ico
GET /someScript.js
GET /img/background.jpg
@gmuecke
Load Function
This Photo by Unknown Author is licensed under CC BY-NC-SA
33
@gmuecke
What is a load function?
 How Load is distributed over time
 Defined by a rate of events in a period
 Users arriving at the application
 Requests
 Actions / Clicks
 Bytes
 Load Functions define when the Load Generator sends a request
34
@gmuecke
Arrival Rate
 Each User acts as an individuum, independent from all other users
 Unknown arrival rates can be best approximated, using a statistical
distribution function
 We need a load generator that can generate
 indepent user requests
 user requests following an arrival rate defined by f(t)
35
@gmuecke
Thread based Load Generation
Thread 1
Virtual User
36
@gmuecke
Thread based Load Generation
Thread 1
Request
Virtual User
37
@gmuecke
Thread based Load Generation
Thread 1
Thread
WAIT
Virtual User
38
@gmuecke
Thread based Load Generation
Thread 1
Response
Virtual User
39
@gmuecke
Thread based Load Generation
Thread 1
Think Time
Virtual User
40
@gmuecke
Thread based Load Generation
Thread 1
User
Scenario
Virtual User
41
@gmuecke
Thread based Load Generation
Thread 1
Pace
time
Virtual User
42
@gmuecke
Thread based Load Generation
Thread 1
Virtual User
Real User 1 Real User 2
43
@gmuecke
Thread based Load Generation
Thread 1
Thread 2
44
Thread 3
@gmuecke
Thread based Load Generation
 Characteristics
 Each Simulated Real User depends on it’s previous user
 Each consecutive Request depends on Response for previous Request
 Requires lot of Resource
 Suffers from Coordinated Omission (SUT throttles Load Generator)
 Rampup ensures that generated load is evenly distributed
 Pacing ensures that load distribution remains stable
 Good for
 Closed User Groups (i.e. Employees, Named Users), Dependant Users
 Determine Capacity
 Tool Example: Apache JMeter
45
@gmuecke
Event Based Load Generation
Event
Thread
Timer Event Response
Event
Async
Request
Async
Response
46
@gmuecke
Event Based Load Generation
Event
Thread
47
More
Users
@gmuecke
Event Based Load Generation
 Characteristics
 Simulated Users are Independent
 Sent Requests are independent from previous Requests
 Requests/Responses are handled asynchronously
 Requires less resources for same load as thread based systems
 No Coordinated Omission
 Limited by the Processing Capacity of the Event-Thread
 Ramp up / down is defined by change in User Rate
 Good for
 Independent Users
 Open User Groups (i.e. for public web sites)
 User Experience Rating
 Tool-Example: Gatling
48
@gmuecke
Gatling
49
@gmuecke
Test Development with Gatling 50
Scenarios Load ModelsPages
@gmuecke
Test Development with Gatling 51
val page1 = exec(
http("request_0")
.get("/")
.headers(acceptHtml)
.resources(...))
Pages Scenarios
val scn =
scenario("Simple")
.exec(page1)
Load Models
scn.inject(
constantUsersPerSec(500)
during (1 minute)
)
@gmuecke
Typical Load Distribution Functions
 Equi-Distribution
 Linear-Distribution
scn.inject(
rampUsersPerSec(10) to 20 during(10 minutes),
constantUsersPerSec(20) during (20 minutes)
)
scn.inject(
rampUsers(10) over(10 seconds)
)
53
@gmuecke
scn.inject(
nothingFor(5 seconds),
rampUsersPerSec(1) to 200 during(10 minutes),
constantUsersPerSec(200) during (30 minute),
rampUsersPerSec(200) to 400 during(10 minutes),
constantUsersPerSec(400) during (30 minute),
)
Typical Load Models
𝑓(𝑡) =
0, 𝑡 < 5 𝑠
𝑡
3
, 5 𝑠 ≤ 𝑡 < 600 𝑠
200, 600𝑠 ≤ 𝑡 < 2400𝑠
𝑡
3
+ 200, 2400𝑠 ≤ 𝑡 < 3000𝑠
400, 𝑡 ≥ 3000𝑠
List of Injection Steps
54
@gmuecke
Statistical Distribution Functions
 Normal-Distribution (Gauss)
 Daily usage patterns
 Binomial Distribution (Bernoulli)
 Poisson Distribution
 Coordinated
 i.e. Scheduled events
𝑓 𝑥 =
1
𝜎 2𝜋
𝑒
−
1
2
𝑥−𝜇
𝜎
2
𝐵 𝑘 𝑝, 𝑛 =
𝑛
𝑘
𝑝 𝑘
1 − 𝑝 𝑛−𝑘
𝑃 𝜆 𝑘 =
𝜆 𝑘
𝑘!
𝑒−𝜆
0
0.1
0.2
0.3
0.00000
0.10000
0.20000
0.30000
0.40000
0
0.02
0.04
0.06
0.08
56
@gmuecke
Combined Functions
 Overlaying two Gauss Functions with different Parameters
 Daily Loads
0
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
𝜎1 = 20
𝜎2 = 15
𝜇1 = 30
𝜇2 = 80
58
@gmuecke
Gauss
 𝑓 𝑥 =
1
𝜎 2𝜋
𝑒
−
1
2
𝑥−𝜇
𝜎
2
This Photo by Unknown Author is licensed under CC BY-SA
def gauss(sigma: Double, mu: Double)(x: Double): Double = {
(1 / (sigma * sqrt(2 * Pi))) * exp(-0.5 * pow((x - mu) / sigma, 2))
}
59
@gmuecke
M-Shape
 𝑓 𝑥 =
𝑓𝜎1 𝜇1 𝑥 +𝑓𝜎2 𝜇2 𝑥
2
def mshape(sigma1: Double, mu1: Double,
sigma2: Double, mu2: Double)(x: Double): Double = {
(gauss(sigma1, mu1)(x) + gauss(sigma2, mu2)(x)) / 2
}
This Photo by Unknown Author
is licensed under CC BY-SA
60
@gmuecke
Binomial
 𝐵 𝑘 𝑝, 𝑛 = 𝑛
𝑘
𝑝 𝑘 1 − 𝑝 𝑛−𝑘
 𝐵 𝑘 𝑝, 𝑛 =
𝑛!
𝑛−𝑘 !𝑘!
𝑛𝑝
𝑛
𝑘
1 −
𝑛𝑝
𝑛
𝑛−𝑘
def binomial(k: Int, p: Double)(n: Double): Double = {
if (k > n) 0
else ((n.toInt !) / ((k !) * (n.toInt - k) !))
* pow(p, k)
* pow(1 - p, n - k)
}
61
@gmuecke
Poisson
 𝑃 𝜆 𝑘 =
𝜆 𝑘
𝑘!
𝑒−𝜆
This Photo by Unknown Author is licensed under CC BY-SA
def poisson(l : Double)(n : Double) : Double = {
exp(-l) * pow(l, n) / (n.toInt!).toDouble
}
63
@gmuecke
Generating the Injection Steps
 Approximation of a continuous function through a series of linear
functions (ramps)
64
0
0.05
0.1
0.15
0.2
0.25
@gmuecke
Generating the Injection Steps 65
def f()= _ => List[InjectionStep]
@gmuecke
Generating the Injection Steps
def continuousUserRate(duration: FiniteDuration,
totalUsers: Int,
distrFun: (Int) => (Double => Double),
stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt):
List[InjectionStep] = {
val steps = stepFun(duration)
val stepDuration = duration / steps
def fun(x: Double) : Double =
totalUsers * distrFun(steps)(x) / stepDuration.toSeconds
List.range(0, steps).map(
step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration)
}
66
@gmuecke
def continuousUserRate(duration: FiniteDuration,
totalUsers: Int,
distrFun: (Int) => (Double => Double),
stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt):
List[InjectionStep] = {
val steps = stepFun(duration)
val stepDuration = duration / steps
def fun(x: Double) : Double =
totalUsers * distrFun(steps)(x) / stepDuration.toSeconds
List.range(0, steps).map(
step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration)
}
Generating the Injection Steps 67
Number of Injection Steps
@gmuecke
def continuousUserRate(duration: FiniteDuration,
totalUsers: Int,
distrFun: (Int) => (Double => Double),
stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt):
List[InjectionStep] = {
val steps = stepFun(duration)
val stepDuration = duration / steps
def fun(x: Double) : Double =
totalUsers * distrFun(steps)(x) / stepDuration.toSeconds
List.range(0, steps).map(
step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration)
}
Generating the Injection Steps 68
Duration of a single step (1 minute)
@gmuecke
def continuousUserRate(duration: FiniteDuration,
totalUsers: Int,
distrFun: (Int) => (Double => Double),
stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt):
List[InjectionStep] = {
val steps = stepFun(duration)
val stepDuration = duration / steps
def fun(x: Double) : Double =
totalUsers * distrFun(steps)(x) / stepDuration.toSeconds
List.range(0, steps).map(
step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration)
}
Generating the Injection Steps
Calculate the user/sec rate for a
specific step using the distribution
function
Calculate the linear change in user/sec
rate between two steps
69
@gmuecke
Generating the Injection Steps
def gaussDistr(sigma: Double = 4, muPercent: Double = 0.5)
(duration: FiniteDuration, totalUsers: Int) =
continuousUserRate(duration, totalUsers,
steps => gauss(sigma, steps * muPercent))
setUp(
ExampleScenario.helloWorld.inject(
gaussDistr(2)(10 minutes, 30000)
)
).protocols(httpServer)
70
@gmuecke
Examples
 Elastic System that dynamically scales up / down depending on
load
 Parameters define the inertia of responding to load
71
@gmuecke
Constant Load 72
@gmuecke
Gauss Distribution 73
@gmuecke
Binomial Distribution 74
@gmuecke
Response Time Historgrams 75
@gmuecke
78
@gmuecke
Functional Load Testing
 Uses Statistical Distribution Functions to Shape the Load Profile
 Generate more realistic load patterns
 Response Time Percentiles better reflect User Experience
 Test dynamic behavior of the system
 Facilitates more realistic Sizing & Capacity Forecast with respect to User
Experience
 Does not replace other forms of load testing
 Is a supplement that provides additional value in certain contexts
79
@gmuecke
 Example source code available at
 https://github.com/gmuecke/flt-example
80
@gmuecke
Thank you!
QUESTIONS & FEEDBACK APPRECIATED!
81

More Related Content

What's hot

Defects in software testing
Defects in software testingDefects in software testing
Defects in software testingsandeepsingh2808
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeterWira Santos
 
Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in SeleniumVinay Kumar Pulabaigari
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationSam Bowne
 
What Is Functional Testing?
What Is Functional Testing?What Is Functional Testing?
What Is Functional Testing?QA InfoTech
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test ResultsEric Proegler
 
Accuracy and time_costs_of_web_app_scanners
Accuracy and time_costs_of_web_app_scannersAccuracy and time_costs_of_web_app_scanners
Accuracy and time_costs_of_web_app_scannersLarry Suto
 
Performance Requirement Gathering
Performance Requirement GatheringPerformance Requirement Gathering
Performance Requirement GatheringAtul Pant
 
Types of software testing
Types of software testingTypes of software testing
Types of software testingTestbytes
 
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...Simplilearn
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & ActuatorsVMware Tanzu
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache JmeterSabitri Gaire
 

What's hot (20)

Defects in software testing
Defects in software testingDefects in software testing
Defects in software testing
 
JMETER-SKILLWISE
JMETER-SKILLWISEJMETER-SKILLWISE
JMETER-SKILLWISE
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeter
 
Batch processing
Batch processingBatch processing
Batch processing
 
Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in Selenium
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
 
Testing strategies
Testing strategiesTesting strategies
Testing strategies
 
What Is Functional Testing?
What Is Functional Testing?What Is Functional Testing?
What Is Functional Testing?
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test Results
 
Accuracy and time_costs_of_web_app_scanners
Accuracy and time_costs_of_web_app_scannersAccuracy and time_costs_of_web_app_scanners
Accuracy and time_costs_of_web_app_scanners
 
Performance Requirement Gathering
Performance Requirement GatheringPerformance Requirement Gathering
Performance Requirement Gathering
 
Types of software testing
Types of software testingTypes of software testing
Types of software testing
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
Owasp webgoat
Owasp webgoatOwasp webgoat
Owasp webgoat
 
JMeter
JMeterJMeter
JMeter
 
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...
JMeter Load Testing | Load Testing Using JMmeter | JMeter Tutorial For Beginn...
 
Sanity testing and smoke testing
Sanity testing and smoke testingSanity testing and smoke testing
Sanity testing and smoke testing
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & Actuators
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache Jmeter
 

Similar to Functional Load Testing with Gatling

Effektives Consulting - Performance Engineering
Effektives Consulting - Performance EngineeringEffektives Consulting - Performance Engineering
Effektives Consulting - Performance Engineeringhitdhits
 
Performance Testing using LoadRunner
Performance Testing using LoadRunnerPerformance Testing using LoadRunner
Performance Testing using LoadRunnerKumar Gupta
 
Reactive data analysis with vert.x
Reactive data analysis with vert.xReactive data analysis with vert.x
Reactive data analysis with vert.xGerald Muecke
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUGslandelle
 
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...chiportal
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
 
Gatling workshop lets test17
Gatling workshop lets test17Gatling workshop lets test17
Gatling workshop lets test17Gerald Muecke
 
Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Gurpreet singh
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load testduke.kalra
 
Ginsbourg.com - Performance and load test report template ltr 2.0
Ginsbourg.com - Performance and load test report template ltr 2.0Ginsbourg.com - Performance and load test report template ltr 2.0
Ginsbourg.com - Performance and load test report template ltr 2.0Shay Ginsbourg
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cAjith Narayanan
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
Performance Engineering - how to start!
Performance Engineering - how to start!Performance Engineering - how to start!
Performance Engineering - how to start!Yoav Weiss
 
Continuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and JmeterContinuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and JmeterAgile Testing Alliance
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1Sun Technlogies
 
谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testabilitydrewz lin
 
Performance testing interview questions and answers
Performance testing interview questions and answersPerformance testing interview questions and answers
Performance testing interview questions and answersGaruda Trainings
 
Distributed Systems at Scale: Reducing the Fail
Distributed Systems at Scale:  Reducing the FailDistributed Systems at Scale:  Reducing the Fail
Distributed Systems at Scale: Reducing the FailKim Moir
 

Similar to Functional Load Testing with Gatling (20)

Effektives Consulting - Performance Engineering
Effektives Consulting - Performance EngineeringEffektives Consulting - Performance Engineering
Effektives Consulting - Performance Engineering
 
Browser Based Performance Testing and Tuning
Browser Based Performance Testing and TuningBrowser Based Performance Testing and Tuning
Browser Based Performance Testing and Tuning
 
Performance Testing using LoadRunner
Performance Testing using LoadRunnerPerformance Testing using LoadRunner
Performance Testing using LoadRunner
 
Reactive data analysis with vert.x
Reactive data analysis with vert.xReactive data analysis with vert.x
Reactive data analysis with vert.x
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUG
 
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
Gatling workshop lets test17
Gatling workshop lets test17Gatling workshop lets test17
Gatling workshop lets test17
 
Jmeter.ppt
Jmeter.pptJmeter.ppt
Jmeter.ppt
 
Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load test
 
Ginsbourg.com - Performance and load test report template ltr 2.0
Ginsbourg.com - Performance and load test report template ltr 2.0Ginsbourg.com - Performance and load test report template ltr 2.0
Ginsbourg.com - Performance and load test report template ltr 2.0
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12c
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
Performance Engineering - how to start!
Performance Engineering - how to start!Performance Engineering - how to start!
Performance Engineering - how to start!
 
Continuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and JmeterContinuous Performance Testing with Taurus and Jmeter
Continuous Performance Testing with Taurus and Jmeter
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1
 
谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability谷歌 Scott-lessons learned in testability
谷歌 Scott-lessons learned in testability
 
Performance testing interview questions and answers
Performance testing interview questions and answersPerformance testing interview questions and answers
Performance testing interview questions and answers
 
Distributed Systems at Scale: Reducing the Fail
Distributed Systems at Scale:  Reducing the FailDistributed Systems at Scale:  Reducing the Fail
Distributed Systems at Scale: Reducing the Fail
 

Recently uploaded

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Recently uploaded (20)

Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

Functional Load Testing with Gatling

  • 1. @gmuecke Functional Load Testing GERALD MÜCKE JAVALAND 2018 𝑓 𝑥 = 1 𝜎 2𝜋 𝑒 − 1 2 𝑥−𝜇 𝜎 2 𝐵 𝑘 𝑝, 𝑛 = 𝑛 𝑘 𝑝 𝑘 1 − 𝑝 𝑛−𝑘 𝑃 𝜆 𝑘 = 𝜆 𝑘 𝑘! 𝑒−𝜆 2
  • 2. @gmuecke This talk is not about  Load Testing a Function  Loading a Function Test  Loading a Test Function  Testing a Load Function  Test Loading a Function  Testing a Function Load It’s about using Functions to conduct Load Testing 4
  • 3. @gmuecke This Photo by Unknown Author is licensed under CC BY-SA This Photo by Unknown Author is licensed under CC BY-SA Siméon Denis Poisson 5 Jakob I. Bernoulli This Photo by Unknown Author is licensed under CC BY-SA Carl Friedrich Gauss
  • 4. @gmuecke What is Testing?  “Software testing is a process of executing a program or application with the intent of finding the software bugs.” (ISTQB)  Testing is a information-providing service, not a "quality assurance" function.  The value of testing is determined by whether it provides useful and timely information.  A tester is a customer advocate. 6
  • 5. @gmuecke "Dieses Foto" von Unbekannter Autor ist lizenziert gemäß CC BY Context is everything  The value of any practice depends on its context.  There are good practices in context, but there are no best practices. (From Seven Principles of Context Driven Testing) 7
  • 6. @gmuecke How to do Performance Testing? 8
  • 7. @gmuecke Type of Load Test Batch Online 9 • Process the most events in the least time • Event Driven • Focus on Low Response Times • Get the most done in the least time and resources • Data Driven • Focus on Maximum Troughput
  • 8. @gmuecke Input to Load Test Scenarios  Performance Requirements  Target Users (Concurrent, per Duration, Total)  Response Time Targets (90%, 95%, 99%)  Throughput  Historical Data  Number of Total Users per Duration  Number of Concurrent Users  Peak Loads (Peak Month/Day/Hour/Minute)  Request Logs  Educated Guesses / Gut Feeling 10
  • 9. @gmuecke Example Requirements  The system is capable of  Serving 1000 concurrent users with an average Response Time of 1.5s  Source: The Project Manager  What are the most relevant information? This Photo by Unknown Author is licensed under CC BY-NC-SA 11
  • 10. @gmuecke Numbers need a Context  Concurrent Users (CPU)  vs. Concurrent Sessions (Memory)  vs. Users per Period (Capacity)  Average  vs. perceived Average (90 %)  vs. Percentiles (95%,99%,99.9%)  1000 Conc.Users, avg < 1.5s  vs 1000 Users/h, 90% < 1.5s This Photo by Unknown Author is licensed under CC BY-NC-SA 12
  • 11. @gmuecke Load Testing Practices  Soak Testing  Discover Leaks  SLA Regressions  Stress Testing  Testing Stability  Overload / Recovery  Benchmarking  Discover Regressions between different Versions or Configurations 13
  • 12. @gmuecke A typical load test: Constant Load  Constant Load  + Ramp up / down  Allowing the System to adapt to Load (warm up)  Distributes Load (virtual users)  Good for:  Finding latent bugs, i.e.Memory or Resource Leaks  Precise Measurements  Regressions  Stability Issues  Statistical Response Times  Known Load Distributions Load % t 14
  • 13. @gmuecke Why do a ramp up?  System Warm-up  Allow JIT to optimize code  Allow Caches to be populated  Fetch or Initiate Resources (i.e. Database Connections)  Allow Queues and Buffers to fill to a stable level  Distribute Load evenly  System’s Performance Characteristics are non-linear during ramup 15 This Photo by Unknown Author is licensed under CC BY-NC-ND
  • 14. @gmuecke But, from the user perspective … This Photo by Unknown Author is licensed under CC BY-NC-ND 17
  • 15. @gmuecke What is the user value of…  My car consumes 4.8 l per 100 km in the benchmark test  Yet in the City, I constantly use more than 6.5 l per 100 km 18
  • 16. @gmuecke What is the user value of…  98% of all trains are on time  Yet, I miss 1 in 10 connecting trains with a connection time of 3 mins  Yet, I miss all connecting trains during peak hours (adding 30mins) 19
  • 17. @gmuecke What is the use value of…  With my car I can drive faster than 200 km/h  Yet, I’m stuck in traffic jams due to road work adding a third lane 20
  • 18. @gmuecke The context of measurement 21 "Dieses Foto" von Unbekannter Autor ist lizenziert gemäß CC BY-SA Scope for Static Load Test Scope for User Experience "Dieses Foto" von Unbekannter Autor ist lizenziert gemäß CC BY-NC A Typical simplification of the system’s users
  • 20. @gmuecke Real Life Scenarios  Singular Events  Launch of Marketing Campaign / Black Friday Sales  Launch of new Service or WebSite  Users Logging in in the morning  Clients connect to a system on schedule  Automated Updates  Daily Patterns  “McDonalds” M  asymmetric-M 24
  • 21. @gmuecke The Challenges  Dynamic Capacity  Systems automatically scale up or down  Systems are Virtualized (especially in the Cloud)  Users come in Masses  A lot of people are online today  Social Media as Amplifier  Viral Marketing 27
  • 22. @gmuecke The information we need  How are users affected during scaling  How are the Response Times (with regard to SLAs)  During unexpected loads  During typical usage (which is not constant)  In order to design a dynamic system that  Is cost-efficient (as small as possible during normal loads)  Can deal with (unexpected) peak loads  Fulfills the SLAs (Reliability, Response Times, Throughput, …) 28
  • 23. @gmuecke Three elements of a Load Test • How groups of users navigate through your application User Flows • How to fetch a typical page and it’s resources Page Scripts • How the users arrive at your page Load Function 29
  • 24. @gmuecke Three elements of a Load Test User Flows Page Scripts Load Function 30 GET /index.html GET /favicon.ico GET /someScript.js GET /img/background.jpg
  • 25. @gmuecke Load Function This Photo by Unknown Author is licensed under CC BY-NC-SA 33
  • 26. @gmuecke What is a load function?  How Load is distributed over time  Defined by a rate of events in a period  Users arriving at the application  Requests  Actions / Clicks  Bytes  Load Functions define when the Load Generator sends a request 34
  • 27. @gmuecke Arrival Rate  Each User acts as an individuum, independent from all other users  Unknown arrival rates can be best approximated, using a statistical distribution function  We need a load generator that can generate  indepent user requests  user requests following an arrival rate defined by f(t) 35
  • 28. @gmuecke Thread based Load Generation Thread 1 Virtual User 36
  • 29. @gmuecke Thread based Load Generation Thread 1 Request Virtual User 37
  • 30. @gmuecke Thread based Load Generation Thread 1 Thread WAIT Virtual User 38
  • 31. @gmuecke Thread based Load Generation Thread 1 Response Virtual User 39
  • 32. @gmuecke Thread based Load Generation Thread 1 Think Time Virtual User 40
  • 33. @gmuecke Thread based Load Generation Thread 1 User Scenario Virtual User 41
  • 34. @gmuecke Thread based Load Generation Thread 1 Pace time Virtual User 42
  • 35. @gmuecke Thread based Load Generation Thread 1 Virtual User Real User 1 Real User 2 43
  • 36. @gmuecke Thread based Load Generation Thread 1 Thread 2 44 Thread 3
  • 37. @gmuecke Thread based Load Generation  Characteristics  Each Simulated Real User depends on it’s previous user  Each consecutive Request depends on Response for previous Request  Requires lot of Resource  Suffers from Coordinated Omission (SUT throttles Load Generator)  Rampup ensures that generated load is evenly distributed  Pacing ensures that load distribution remains stable  Good for  Closed User Groups (i.e. Employees, Named Users), Dependant Users  Determine Capacity  Tool Example: Apache JMeter 45
  • 38. @gmuecke Event Based Load Generation Event Thread Timer Event Response Event Async Request Async Response 46
  • 39. @gmuecke Event Based Load Generation Event Thread 47 More Users
  • 40. @gmuecke Event Based Load Generation  Characteristics  Simulated Users are Independent  Sent Requests are independent from previous Requests  Requests/Responses are handled asynchronously  Requires less resources for same load as thread based systems  No Coordinated Omission  Limited by the Processing Capacity of the Event-Thread  Ramp up / down is defined by change in User Rate  Good for  Independent Users  Open User Groups (i.e. for public web sites)  User Experience Rating  Tool-Example: Gatling 48
  • 42. @gmuecke Test Development with Gatling 50 Scenarios Load ModelsPages
  • 43. @gmuecke Test Development with Gatling 51 val page1 = exec( http("request_0") .get("/") .headers(acceptHtml) .resources(...)) Pages Scenarios val scn = scenario("Simple") .exec(page1) Load Models scn.inject( constantUsersPerSec(500) during (1 minute) )
  • 44. @gmuecke Typical Load Distribution Functions  Equi-Distribution  Linear-Distribution scn.inject( rampUsersPerSec(10) to 20 during(10 minutes), constantUsersPerSec(20) during (20 minutes) ) scn.inject( rampUsers(10) over(10 seconds) ) 53
  • 45. @gmuecke scn.inject( nothingFor(5 seconds), rampUsersPerSec(1) to 200 during(10 minutes), constantUsersPerSec(200) during (30 minute), rampUsersPerSec(200) to 400 during(10 minutes), constantUsersPerSec(400) during (30 minute), ) Typical Load Models 𝑓(𝑡) = 0, 𝑡 < 5 𝑠 𝑡 3 , 5 𝑠 ≤ 𝑡 < 600 𝑠 200, 600𝑠 ≤ 𝑡 < 2400𝑠 𝑡 3 + 200, 2400𝑠 ≤ 𝑡 < 3000𝑠 400, 𝑡 ≥ 3000𝑠 List of Injection Steps 54
  • 46. @gmuecke Statistical Distribution Functions  Normal-Distribution (Gauss)  Daily usage patterns  Binomial Distribution (Bernoulli)  Poisson Distribution  Coordinated  i.e. Scheduled events 𝑓 𝑥 = 1 𝜎 2𝜋 𝑒 − 1 2 𝑥−𝜇 𝜎 2 𝐵 𝑘 𝑝, 𝑛 = 𝑛 𝑘 𝑝 𝑘 1 − 𝑝 𝑛−𝑘 𝑃 𝜆 𝑘 = 𝜆 𝑘 𝑘! 𝑒−𝜆 0 0.1 0.2 0.3 0.00000 0.10000 0.20000 0.30000 0.40000 0 0.02 0.04 0.06 0.08 56
  • 47. @gmuecke Combined Functions  Overlaying two Gauss Functions with different Parameters  Daily Loads 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 𝜎1 = 20 𝜎2 = 15 𝜇1 = 30 𝜇2 = 80 58
  • 48. @gmuecke Gauss  𝑓 𝑥 = 1 𝜎 2𝜋 𝑒 − 1 2 𝑥−𝜇 𝜎 2 This Photo by Unknown Author is licensed under CC BY-SA def gauss(sigma: Double, mu: Double)(x: Double): Double = { (1 / (sigma * sqrt(2 * Pi))) * exp(-0.5 * pow((x - mu) / sigma, 2)) } 59
  • 49. @gmuecke M-Shape  𝑓 𝑥 = 𝑓𝜎1 𝜇1 𝑥 +𝑓𝜎2 𝜇2 𝑥 2 def mshape(sigma1: Double, mu1: Double, sigma2: Double, mu2: Double)(x: Double): Double = { (gauss(sigma1, mu1)(x) + gauss(sigma2, mu2)(x)) / 2 } This Photo by Unknown Author is licensed under CC BY-SA 60
  • 50. @gmuecke Binomial  𝐵 𝑘 𝑝, 𝑛 = 𝑛 𝑘 𝑝 𝑘 1 − 𝑝 𝑛−𝑘  𝐵 𝑘 𝑝, 𝑛 = 𝑛! 𝑛−𝑘 !𝑘! 𝑛𝑝 𝑛 𝑘 1 − 𝑛𝑝 𝑛 𝑛−𝑘 def binomial(k: Int, p: Double)(n: Double): Double = { if (k > n) 0 else ((n.toInt !) / ((k !) * (n.toInt - k) !)) * pow(p, k) * pow(1 - p, n - k) } 61
  • 51. @gmuecke Poisson  𝑃 𝜆 𝑘 = 𝜆 𝑘 𝑘! 𝑒−𝜆 This Photo by Unknown Author is licensed under CC BY-SA def poisson(l : Double)(n : Double) : Double = { exp(-l) * pow(l, n) / (n.toInt!).toDouble } 63
  • 52. @gmuecke Generating the Injection Steps  Approximation of a continuous function through a series of linear functions (ramps) 64 0 0.05 0.1 0.15 0.2 0.25
  • 53. @gmuecke Generating the Injection Steps 65 def f()= _ => List[InjectionStep]
  • 54. @gmuecke Generating the Injection Steps def continuousUserRate(duration: FiniteDuration, totalUsers: Int, distrFun: (Int) => (Double => Double), stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt): List[InjectionStep] = { val steps = stepFun(duration) val stepDuration = duration / steps def fun(x: Double) : Double = totalUsers * distrFun(steps)(x) / stepDuration.toSeconds List.range(0, steps).map( step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration) } 66
  • 55. @gmuecke def continuousUserRate(duration: FiniteDuration, totalUsers: Int, distrFun: (Int) => (Double => Double), stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt): List[InjectionStep] = { val steps = stepFun(duration) val stepDuration = duration / steps def fun(x: Double) : Double = totalUsers * distrFun(steps)(x) / stepDuration.toSeconds List.range(0, steps).map( step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration) } Generating the Injection Steps 67 Number of Injection Steps
  • 56. @gmuecke def continuousUserRate(duration: FiniteDuration, totalUsers: Int, distrFun: (Int) => (Double => Double), stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt): List[InjectionStep] = { val steps = stepFun(duration) val stepDuration = duration / steps def fun(x: Double) : Double = totalUsers * distrFun(steps)(x) / stepDuration.toSeconds List.range(0, steps).map( step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration) } Generating the Injection Steps 68 Duration of a single step (1 minute)
  • 57. @gmuecke def continuousUserRate(duration: FiniteDuration, totalUsers: Int, distrFun: (Int) => (Double => Double), stepFun: (Duration) => (Int) = (d) => d.toMinutes.toInt): List[InjectionStep] = { val steps = stepFun(duration) val stepDuration = duration / steps def fun(x: Double) : Double = totalUsers * distrFun(steps)(x) / stepDuration.toSeconds List.range(0, steps).map( step => rampUsersPerSec(fun(step)) to fun(step + 1) during stepDuration) } Generating the Injection Steps Calculate the user/sec rate for a specific step using the distribution function Calculate the linear change in user/sec rate between two steps 69
  • 58. @gmuecke Generating the Injection Steps def gaussDistr(sigma: Double = 4, muPercent: Double = 0.5) (duration: FiniteDuration, totalUsers: Int) = continuousUserRate(duration, totalUsers, steps => gauss(sigma, steps * muPercent)) setUp( ExampleScenario.helloWorld.inject( gaussDistr(2)(10 minutes, 30000) ) ).protocols(httpServer) 70
  • 59. @gmuecke Examples  Elastic System that dynamically scales up / down depending on load  Parameters define the inertia of responding to load 71
  • 65. @gmuecke Functional Load Testing  Uses Statistical Distribution Functions to Shape the Load Profile  Generate more realistic load patterns  Response Time Percentiles better reflect User Experience  Test dynamic behavior of the system  Facilitates more realistic Sizing & Capacity Forecast with respect to User Experience  Does not replace other forms of load testing  Is a supplement that provides additional value in certain contexts 79
  • 66. @gmuecke  Example source code available at  https://github.com/gmuecke/flt-example 80
  • 67. @gmuecke Thank you! QUESTIONS & FEEDBACK APPRECIATED! 81