Created
September 5, 2014 06:34
-
-
Save maiha/73f8aff2abb403cc4dae to your computer and use it in GitHub Desktop.
gatling-inspect-session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package study | |
/** gatling-2.0.0-RC3 | |
* @example{ | |
* ./bin/gatling.sh -nr -s study.InspectSession | |
* } | |
*/ | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import io.gatling.core.validation.Success | |
class InspectSession extends Simulation { | |
val httpProtocol = http.baseURL("http://localhost") | |
.inferHtmlResources() | |
val scn = scenario("inspect session") | |
.exec(http("Home").get("/")) | |
.exec(session => { | |
println(s"session=${session}") | |
Success[Session](session) // need for validation | |
}) | |
setUp(scn.inject(rampUsers(1) over(1)).protocols(httpProtocol)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, you don't even need to wrap explicitly the session in a Success, there's an implicit that would do it automatically for you.
You can just write: