22
1 Réaliser des tests de charge avec Gatling par Stéphane Landelle @slandelle & Romain Sertelon @BluePyth

Gatling Tool in Action at DevoxxFR 2012

Embed Size (px)

DESCRIPTION

Gatling Tool in Action talk @DevoxxFr 2012. Gatling is an effecient asynchronous stress test tool. http://gatling-tool.org

Citation preview

Page 1: Gatling Tool in Action at DevoxxFR 2012

1

Réaliser destests de charge

avec Gatlingpar Stéphane Landelle @slandelle

& Romain Sertelon @BluePyth

Page 2: Gatling Tool in Action at DevoxxFR 2012

2

Plan

•Pourquoi un nième injecteur ?

•Solution

•Démo

Page 3: Gatling Tool in Action at DevoxxFR 2012

3

Pourquoi un nième injecteur ?

Page 4: Gatling Tool in Action at DevoxxFR 2012

4

Problème 1:

Les performances

Page 5: Gatling Tool in Action at DevoxxFR 2012

5

1 utilisateur = 1 thread

Page 6: Gatling Tool in Action at DevoxxFR 2012

6

~50 threads/JVM

Page 7: Gatling Tool in Action at DevoxxFR 2012

7

~2000 threads/JVM

Page 8: Gatling Tool in Action at DevoxxFR 2012

8

IO bloquants

Page 9: Gatling Tool in Action at DevoxxFR 2012

9

Au fait, que font ces threads?

Ils attendent…

Page 10: Gatling Tool in Action at DevoxxFR 2012

10

Et sinon?

Ils dorment…

Page 11: Gatling Tool in Action at DevoxxFR 2012

11

Problème 2:

Utilisabilité & Maintenabilité

Page 12: Gatling Tool in Action at DevoxxFR 2012

12

Une interface graphique ?

Page 13: Gatling Tool in Action at DevoxxFR 2012

13

Du XML ?<?xml version="1.0" encoding="UTF-8"?><jmeterTestPlan version="1.2" properties="2.1">  <hashTree>    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">      <stringProp name="TestPlan.comments"></stringProp>      <boolProp name="TestPlan.functional_mode">false</boolProp>      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments">        <collectionProp name="Arguments.arguments"/>      </elementProp>      <stringProp name="TestPlan.user_define_classpath"></stringProp>    </TestPlan>    <hashTree>      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel">          <boolProp name="LoopController.continue_forever">false</boolProp>          <stringProp name="LoopController.loops">1</stringProp>        </elementProp>        <stringProp name="ThreadGroup.num_threads">1500</stringProp>        <stringProp name="ThreadGroup.ramp_time">200</stringProp>       

Page 14: Gatling Tool in Action at DevoxxFR 2012

14

Solution

•Portable (JVM)

•Réellement asynchrone

•Ergonomique

•Evolutive

Page 15: Gatling Tool in Action at DevoxxFR 2012

15

Async = Acteurs

Page 16: Gatling Tool in Action at DevoxxFR 2012

16

Async = IO non bloquants

•Netty

•Async Http Client

Page 17: Gatling Tool in Action at DevoxxFR 2012

17

Scénarios=

DSL

Page 18: Gatling Tool in Action at DevoxxFR 2012

18

Scénarios = code val scn = scenario("My Scenario") .exec(http("Login page").get("/login.html"))

.exec(http("Login").post("/login") .param("username", "foo") .param("password", "bar"))

.loop( chain.exec(http("Home").get("/home.html") .check(regex("""<a href="/account/(ACC[0-9]*)">""")) ) ).times(5)

Page 19: Gatling Tool in Action at DevoxxFR 2012

19

Démo !

Page 20: Gatling Tool in Action at DevoxxFR 2012

20

Screenshot recorder 1

Page 21: Gatling Tool in Action at DevoxxFR 2012

21

Screenshot recorder 2

Page 22: Gatling Tool in Action at DevoxxFR 2012

22

Conclusion

http://gatling-tool.org

@GatlingTool

https://github.com/excilys/gatling