Skip to content

Instantly share code, notes, and snippets.

@maiha
Created September 5, 2014 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/d4e3285245967efe48de to your computer and use it in GitHub Desktop.
Save maiha/d4e3285245967efe48de to your computer and use it in GitHub Desktop.
use akka actor in gatling
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))
}
@UserNoOne
Copy link

do you have sample gist that supports gatling new versions ? looks like this is now available anymore io.gatling.core.akka.GatlingActorSystem.instance

@maiha
Copy link
Author

maiha commented Sep 23, 2020

@UserNoOne
Sorry, I don't know about the latest libraries as I don't use Scala anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment