Does Gatling has a limitations to show in a report how many SSE events came in a stream? I set a check, unfortunately I see just 1 execution (1 matched message) in a log and report , although I get many same events…
If I paste more than 120, I get an Error. If I set JAVA_OPTS=-Xss128Mb, I get an error again
15:55:21.461 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed
java.lang.StackOverflowError: null
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:675)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:5080)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:5110)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5991)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6047)
at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:6145)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5992)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:6047)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$41(Typers.scala:5078)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:698)
"Sometimes, you might want to dynamic parameters that are too complex to compute for Gatling EL. Most Gatling DSL methods can also be passed a function to compute your parameter value programmatically.
Those functions are executed in Gatling’s shared threads, so you must absolutely avoid performing long blocking operations in there]
Honestly, your core issue is that you’re trying to use Gatling Scala and code things without any knowledge about the Scala syntax.
For almost 2 years, Gatling has had a Java API. Nowadays, this Java API is the recommended one.
The Scala API should only be used by Scala developers. Gatling users shouldn’t have to first learn Scala in order to use Gatling.
cannot be applied to (Unit)
exec takes a parameter. You’re not passing any (Unit is similar to “nothing” in Scala).
You should be writing:
.exec(
var acc: SseSetCheckBuilder = sse("SetCheck").setCheck
for (_ <- 0 to 200) {
acc = acc.await(60)(sseCheckPushmessages)
}
// in Scala, no need for "return",
// the result of the last operation in a block is returned
acc
)
There are many examples of load testing with Gatling in Scala, but not in Java. That’s why I selected Scala.
But there is no examples how to use SseSetCheckBuilder neither in Scala nor in Java.
I did not find any example for usage of SseSetCheckBuilder in Java/Scala (Gatling).
No examples of subject which I posted here. I am surprised that nobody met my problem before. Is someone tested SSE with Gatling or just high-level (connect - 1 check - close) ? =)
> 00:27:01.892 [ERROR] i.g.c.ZincCompiler$ - c:/Distrib/gatling-charts-highcharts-bundle-3.9.2/user-files/simulations/sandbox/SseSandboxGatlingJ.java:27:1: cannot find symbol
symbol: variable setCheck
location: class io.gatling.javaapi.http.Sse
sse("SetCheck").setCheck
00:27:01.979 [ERROR] i.g.c.ZincCompiler$ - c:/Distrib/gatling-charts-highcharts-bundle-3.9.2/user-files/simulations/sandbox/SseSandboxGatlingJ.java:35:1: cannot find symbol
symbol: method sseCheckPushmessages()
location: class sandbox.SseSandboxGatlingJ
sseCheckPushmessages
00:27:01.989 [ERROR] i.g.c.ZincCompiler$ - c:/Distrib/gatling-charts-highcharts-bundle-3.9.2/user-files/simulations/sandbox/SseSandboxGatlingJ.java:35:1: no suitable method found for await(int)
method io.gatling.http.action.sse.SseAwaitActionBuilder.await(scala.concurrent.duration.FiniteDuration,scala.collection.immutable.Seq<io.gatling.http.check.sse.SseMessageCheck>) is not applicable
> (actual and formal argument lists differ in length)
> method io.gatling.http.action.sse.SseAwaitActionBuilder.await(scala.Function1<io.gatling.core.session.Session,io.gatling.commons.validation.Validation<scala.concurrent.duration.FiniteDuration>>,scala.collection.immutable.Seq<io.gatling.http.check.sse.SseMessageCheck>) is not applicable
> (actual and formal argument lists differ in length)
> method io.gatling.http.action.sse.SseSetCheckBuilder.await(scala.concurrent.duration.FiniteDuration,scala.collection.immutable.Seq) is not applicable
> (actual and formal argument lists differ in length)
> method io.gatling.http.action.sse.SseSetCheckBuilder.await(scala.Function1,scala.collection.immutable.Seq) is not applicable
> (actual and formal argument lists differ in length)
There are many examples of load testing with Gatling in Scala, but not in Java. That’s why I selected Scala.
There’s indeed lots of outdated third party blog posts about Gatling Scala.
All the official documentation and online courses are available in Java.
If you’re not already gone too far with Scala, I would really recommend switching to Java, things will probably get way clearer for you wrt custom code.
sse(“SetCheck”).setCheck
Indeed, this doesn’t compile in Java.
Please have a look at the documentation, you’ll see that you’re missing the parens
From my experience I used your documentation (quickstart, advanced, Academy, javadoc) and could not understand why I see only 1 check. Only with your support here I could find the solution. Now I see that Gatling can be applied for load testing of SSE!