Hi,
first: I’m using gatling 1.5.6.
due to special needs (some part of my script have a binary protocol over http) I must write a custom gatling protocol (following http://gatling.io/docs/1.5.6/developing_gatling/implementing_your_own_protocol_support.html). See below for the code.
It is working fine. But I would like to use feeders. But feed variables are not translated automatically from “{ip}” to session.getAttribute(“ip”).
Is there a piece of code/a way to tell gatling to parse strings to translate from feeder variables?
Thank you
Nicolas
class AppletCommunicationAction1(ip: String, requestName: String, next: ActorRef) extends Action {
def execute(session: Session) {
val requestStartDate = currentTimeMillis()
val responseEndDate = currentTimeMillis()
val requestName = “custom request”
println("execute AppletCommunication “+ip+” "+session.getAttribute(“ip”))
DataWriter.logRequest(session.scenarioName,
session.userId,
"Request " + requestName,
requestStartDate,
responseEndDate,
requestStartDate,
responseEndDate,
RequestStatus.OK)
next ! session
}
def next() = next
}
object AppletCommunicationBuilder {
def action1(ip: String, requestName: String) = new AppletCommunicationAction1Builder(ip, requestName,null)
}
class AppletCommunicationAction1Builder(val ip: String, requestName: String, next:ActorRef) extends ActionBuilder {
def withNext(next: ActorRef) = new AppletCommunicationAction1Builder(ip,requestName,next)
def build(registry: ProtocolConfigurationRegistry): ActorRef = { system.actorOf(Props(new AppletCommunicationAction1(ip, requestName, next))) }
}
object AppletCommunication {
/**
- This method kicks off our DSL for a binary action.