-
Notifications
You must be signed in to change notification settings - Fork 0
Protocol support
Work in Progress!
An Action is the actual component in charge of "doing something", like sending a request (or looping, routing, etc). It must:
- extend the
com.excilys.ebi.gatling.core.action.Actiontrait - implement the
def execute(session: Session)method.
This method has to perform the following operations:
- send the request
- retrieve the response
- perform checks on the response (optional)
- save elements from the checks into the session for further usage (optional)
- log the outcome:
DataWriter.logRequest(session.scenarioName,
session.userId,
"Request " + requestName,
requestStartDate: Long,
responseEndDate: Long,
endOfRequestSendingDate: Long,
endOfRequestSendingDate: Long,
requestResult: RequestStatus,
requestMessage: String)- calling the next action in the chain:
next ! sessionNote that an Action is basically an Akka Actor that handles Session messages. An Action instance is to be shared among users.
An ActionBuilder is what is expected in the DSL. It is used at engine start up for building Action instances.
An ActionBuilder is to be stateless and immutable so it can be reused at multiple places in the scenario and produce multiple unrelated Actions instances.
It expects an implementation of the following methods:
private[gatling] def withNext(next: ActorRef): ActionBuilderreturns a new ActionBuilder instance with a reference to the given ActorRef. An ActorRef is a stub on an Akka actor.
This method is called at engine startup when attaching the builder in the scenario chain.
private[gatling] def build(registry: ProtocolConfigurationRegistry): ActorRefbuilds the Action and starts it. It take a ProtocolConfigurationRegistry parameter that is basically a Map of protocol specific option (such as outgoing proxy for HTTP). For starting and returning an Actor from an Action instance, use the following:
com.excilys.ebi.gatling.core.action.system.actorOf(Props(myActionInstance))- Introduction
- Underlying Technologies
- Concepts
- Benchmarks
- Sponsors
- Changelog
- Migrating
- License
- FAQ
- Contributing
- Links
- Tutorial
- Reference
- Cookbooks
- Retry
- Scaling out
- Passing parameters
- Webservices
- Extensions
- General information
- APIs
- Checks API
- Request API
- Charting API
- Feeder API