Assign grouping to individual http requests?

Hello,

I have a chain of interleaved PUTs and GETs (actually is POST - PUT - GET - PUT - GET etc).
I would like the PUTs statistics to roll up into a group while the GET statistics would roll up into a different group. The reason for this is because of the very different performance profiles of my PUTs and my GETS.

Is there a way to do this? The current grouping as I understand it does not allow me this interleaved chain.

Hi,

You’d have to wrap each request inside a group, and use the same group name for all the GETs and the same name for all the PUTs.
This way, the reporting engine will use the same key and compute overall statistics.

You can write helper methods for this (pseudo code).

def put(request: HttpRequestBuilder) =
group(“PUT”) {
exec(request)
}

def get(request: HttpRequestBuilder) =
group(“GET”) {
exec(request)
}

Cheers,

Hello Stéphane,

Thank you for the suggestion. I defined the helper methods as follows:

def gput(request: HttpRequestBuilder) =
group(“PUT”) {
exec(request)
}

def gget(request: HttpRequestBuilder) =
group(“GET”) {
exec(request)
}

Then I use them in the request builder like this:

val repeatingChain = gput(http(“iCNN_Fixed_put/${counterName}”)
.put(Global.baseServiceEndpoint + “/incnlp/sessions/${nlpSessionId}/${counterName}”)
.headers(headers_0)
.body(RawFileBody(“iNLPconsultNote4Normal_0175_request.txt”))
.basicAuth("${User}", “${Pass}”))
.pause(1)
.gget(http(“iCNN_Fixed_get/${counterName}”)
.get(Global.baseServiceEndpoint + “/incnlp/sessions/${nlpSessionId}/${counterName}?timeout=1511”)
.basicAuth("${User}", “${Pass}”))
.pause(5)

I get a compilation error for the gget: value gget is not a member of io.gatling.core.structure.ChainBuilder.

Do you know how I could resolve this?

easiest way is exec(gget…)

Sure enough. Merci.