Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gatling.io - load testing made easy!

Gatling.io - load testing made easy!

Continuous web performance testing made easy with gatling.
#t3cs15

Daniel Lienert

May 09, 2015
Tweet

More Decks by Daniel Lienert

Other Decks in Programming

Transcript

  1. Gatling
    STRESS  TOOL
     
    Automatic load testing made easy!

    View Slide

  2. Daniel Lienert
    Softwarearchitekt / ScrumMaster
    @ punkt.de
    Twitter: @dlienert
    Web: daniel.lienert.cc

    View Slide

  3. An extra 500 millisecods in search page
    generation time dropped traffic by 20%.
    Every 100 millisecods of latency
    costs 1% in sales.

    View Slide

  4. Teststack
    Unit Tests
    class  ProcessorTest  extends  UnitTestCase  {  
     
     /**  @test  */  
     public  func0on  process()  {  
       ...  
     }  }  
    Functional
    Tests
    class  ProcessorTest  extends  Func  
     /**  @test  */  
     public  func0on  process()  {  
       ...  
     }  }  
    Acceptance
    Tests
    Feature:  
       In  order  to  sell  products  
       as  a  store  employee  
       I  want  to  use  the  sales  app  
     
    ....  
    Performance
    Tests jMeter??

    View Slide

  5. jMeter

    View Slide

  6. •  Written in Scala
    •  NonBlocking IO / Asynchronous
    –  Less Resourcen / better performance then jMeter
    •  Testcases written in Scala DSL
    gatling.io
     
    Gatling

    View Slide

  7. Teststack
    Unit Tests
    class  ProcessorTest  extends  UnitTestCase  {  
     
     /**  @test  */  
     public  func0on  process()  {  
       ...  
     }  }  
    Functional
    Tests
    class  ProcessorTest  extends  Func  
     /**  @test  */  
     public  func0on  process()  {  
       ...  
     }  }  
    Acceptance
    Tests
    Feature:  
       In  order  to  sell  products  
       as  a  store  employee  
       I  want  to  use  the  sales  app  
     
    ....  
    Performance
    Tests
    class  PerformanceTest  extends  Simulaval  scnHome  =  scenario("Show  the  homepage“)  
               .exec(hKp("Homepage").get("/index.php"))  

    View Slide

  8. Show me
    CODE!

    View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. Injection Profiles
    Injection Profiles
    –  nothingFor
    –  atOnceUsers
    –  rampUsers
    –  constantUsersPerSec
    –  rampUsersPerSec
    –  splitUsers
    –  heavisideUsers

    View Slide

  17. Loops
    Loop Types
    –  forever
    –  repeat
    –  during
    –  asLongAs
    –  foreach

    View Slide

  18. Feeder
    Feeder Types
    – csv, tsv, ssv
    – jsonFile, jsonUrl
    – jdbcFeeder
    – redisFeeder
    Feeder Strategies
    – queue
    – random
    – circular

    View Slide

  19. Assertions
    Scopes
    –  global
    –  forAll
    –  details
    Conditions
    –  lessThan
    –  greaterThan
    –  between
    –  is
    –  in
    Statistics
    –  responseTime
    –  allRequests
    –  failedRequests
    –  successfulRequests
    –  requestsPerSec

    View Slide

  20. Checks
    Header & Request
    –  status
    –  currentLocation
    –  header
    –  headerRegex
    –  responseTimeInMillis
    –  latencyInMillis
    Body
    –  bodyString
    –  bodyBytes
    –  substring
    –  regex
    –  xpath
    –  jsonPath, jsonpJsonPath
    –  css

    View Slide

  21. Application Control
    Body Manipulation
    –  body
    –  bodyPart
    –  formParam
    –  multivaluedFormParam
    –  formParamsMap
    –  formUpload

    View Slide

  22. ... or record ...

    View Slide

  23. Launch

    View Slide

  24. Launch
    bin/gatling.sh \!
    -df Data/ \!
    -sf Tests/Performance/Simulations/ \!
    -rf Tests/Performance/Reports/ \!
    -s typo3Project.performanceTest!

    View Slide

  25. ---- Show the homepage ---------------------------------------------------------!
    [##########################################################################]100%!
    waiting: 0 / active: 0 / done:1!
    ---- Requests ------------------------------------------------------------------!
    > Global (OK=1 KO=0 )!
    > Homepage (OK=1 KO=0 )!
    ================================================================================!
    !
    Simulation finished!
    Parsing log file(s)...!
    Parsing log file(s) done!
    Generating reports...!
    !
    ================================================================================!
    ---- Global Information --------------------------------------------------------!
    > request count 1 (OK=1 KO=0 )!
    > min response time 462 (OK=462 KO=- )!
    > max response time 462 (OK=462 KO=- )!
    > mean response time 462 (OK=462 KO=- )!
    > std deviation 0 (OK=0 KO=- )!
    > response time 50th percentile 462 (OK=462 KO=- )!
    > response time 75th percentile 462 (OK=462 KO=- )!
    > mean requests/sec 1.821 (OK=1.821 KO=- )!
    ---- Response Time Distribution ------------------------------------------------!
    > t < 800 ms 1 (100%)!
    > 800 ms < t < 1200 ms 0 ( 0%)!
    > t > 1200 ms 0 ( 0%)!
    > failed 0 ( 0%)!
    ================================================================================!

    View Slide

  26. Executive Summary

    View Slide

  27. Testrunner
    •  Maven
    •  SBT (Scala Build Tool)
    TYPO3  Flow  Command  
     
    Test Folders
    Flow Gatling Command
    Jenkins
    Statistics Report

    View Slide

  28. View Slide

  29. QUESTIONS  ?  
    Feedback:  @dlienert  

    View Slide

  30. Resources
    •  gatling.io
    •  dashing.io
    •  jenkins-ci.org

    View Slide