Created
September 5, 2014 07:49
-
-
Save maiha/d4e3285245967efe48de to your computer and use it in GitHub Desktop.
use akka actor in gatling
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.UseAkkaActor | |
* } | |
*/ | |
import io.gatling.core.Predef._ | |
import io.gatling.http.Predef._ | |
import akka.actor._ | |
class UseAkkaActor extends Simulation { | |
class Ping extends Actor { | |
def receive = { | |
case s: String => println(s"Ping got: $s") | |
} | |
} | |
val system = io.gatling.core.akka.GatlingActorSystem.instance | |
val ping = system.actorOf(Props(new Ping)) | |
val scn = scenario("use akka actor") | |
.exec( session => { | |
ping ! "hello" | |
session | |
}) | |
val httpProtocol = http.baseURL("http://localhost") | |
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
do you have sample gist that supports gatling new versions ? looks like this is now available anymore io.gatling.core.akka.GatlingActorSystem.instance