anchor.diff:  :data-uri:
   :copyright: Creative-Commons-Zero (Arnauld Van Muysewinkel)
   :icons:
  +:br: pass:[<br>]
   
   _(link:../0-extra/1-training_plan.html#(5)[back to plan])_
   
  
positive.code: * Prerequisites
  * Installation
  * Verification
  
  
  Prerequisites
  
negative.code: ^C
  ----
  
  
  Simple benchmarking (launch app)
  --------------------------------
  
  * The subdirectory +app00+ contains a very simple webapp
  ** The webapp echoes the HTTP request headers
  * No container is required: built using +com.sun.net.httpserver.HttpServer+ (included in the Oracle JRE)
  * Compile the app:
  ----
  $ cd app00
  $ ./compile.sh # "compile.bat" under CMD.EXE
  ----
  * Launch the app:
  ----
  $ ./runserver.sh # "runserver.bat" under CMD.EXE
  Server is listening on port 7666
  ----
  ** Should the port not be free, you can change it by editing the launch script (option +-p<port>+)
  
  
  Simple benchmarking (verify app)
  --------------------------------
  
  * Open a new CLI (remember to execute +. setenv.sh+ or +setenv.bat+)
  * Check that the webapp correctly answers to request{br}
  _(the exact output may slightly differ depending on your curl version)_:
  ----
  $ curl localhost:7666 # adapt the port number if required
  Accept=[*/*]
  Host=[localhost:7666]
  User-agent=[curl/7.45.0]
  ----
  * Use your browser to navigate to +http://localhost:7666+{br}
  and compare the results
  
  
  Simple benchmarking (jmeter)
  ----------------------------
  
  * In your second CLI, launch jmeter:
  ----
  $ jmeter # or "jm"
  ----
  * Right-click on "Test Plan" >> Add >> Threads (Users) >> Thread Group
  * Right-click on "Thread Group" >> Add >> Sampler >> HTTP Request
  * Left-click on "HTTP Request", and key in the following fields:
  ** Server name or IP: [ localhost ]
  ** Port Number: [ 7666 ]
  * Right-click on "HTTP Request" >> Add >> Listener >> View Results Tree
  * Menu "File" >> Save
  ** Choose an appropriate location and name to save your performance test script (e.g. +src/main/jmeter/app00.jmx+)
  * Menu "Run" >> Start
  ** The test is executed
  * Check the response by examining the "View Results Tree" panel
  
  