Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print correlation values on console in gatling

How can we print the values captured using saveAs("myValue") on the console of gatling, like we do System.out.println() in Java?

like image 359
UmeshPathak Avatar asked May 12 '16 00:05

UmeshPathak


1 Answers

Values saved with saveAs, are saved into session : Docs : http://gatling.io/docs/2.2.0/session/session_api.html#id2

Those values are actually logged into console automatically if you turn logging on in settings: resources/logback.xml uncomment :

<logger name="io.gatling.http.ahc" level="TRACE" /> 
<logger name="io.gatling.http.response" level="TRACE" /> 

With this settings you will see this before each reqest:

Session: Session(<Session desc.>,5846298469383031361-23,Map(<session vars>),1463134760217,8,KO,List(),<function1>)

Or you have to print your vars in session function:

val printSesssionVar = scenario("print session var").exec{
    session =>
      println(session("<your session var>").as[String])
      session
  }
like image 186
cvakiitho Avatar answered Oct 23 '22 03:10

cvakiitho