gatling-prometheus-datawriter icon indicating copy to clipboard operation
gatling-prometheus-datawriter copied to clipboard

compilation error (type missing + type mismatch) - gatling version 3.4.1 seems incompatible

Open marcusphi opened this issue 4 years ago • 4 comments

After adding

<dependency>
  <groupId>com.github.bmaguireibm</groupId>
  <artifactId>prometheusplugin_2.12</artifactId>
  <version>0.0.1</version>
  <scope>test</scope>
</dependency>

I get a compilation error:

[INFO] --- scala-maven-plugin:4.4.0:testCompile (default) @ adept-load-test ---
[INFO] Using incremental compilation using Mixed compile order
[INFO] Compiler bridge file: /Users/marphi/.sbt/1.0/zinc/org.scala-sbt/org.scala-sbt-compiler-bridge_2.12-1.3.5-bin_2.12.12__55.0-1.3.5_20200330T000931.jar
[INFO] Compiling 1 Scala source to .../my-project/target/test-classes ...

[ERROR] .../my-project/src/test/scala/AdeptReleaseMorningSimulation.scala:3: Symbol 'type io.gatling.core.util.ResourceCache' is missing from the classpath.
This symbol is required by 'trait io.gatling.http.feeder.SitemapFeederSupport'.
Make sure that type ResourceCache is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'SitemapFeederSupport.class' was compiled against an incompatible version of io.gatling.core.util.

[ERROR] .../my-project/src/test/scala/AdeptReleaseMorningSimulation.scala:58: type mismatch;
 found   : io.gatling.core.check.CheckBuilder[io.gatling.core.check.extractor.jsonpath.JsonPathCheckType,Any,String]
 required: io.gatling.http.check.HttpCheck

[ERROR] .../my-project/src/test/scala/AdeptReleaseMorningSimulation.scala:98: type mismatch;
 found   : io.gatling.core.check.CheckBuilder[io.gatling.core.check.extractor.jsonpath.JsonPathCheckType,Any,String]
 required: io.gatling.http.check.HttpCheck

[ERROR] three errors found

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.932 s
[INFO] Finished at: 2020-11-04T15:29:08+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.4.0:testCompile (default) on project adept-load-test: Execution default of goal net.alchim31.maven:scala-maven-plugin:4.4.0:testCompile failed.: CompileFailed -> [Help 1]

marcusphi avatar Nov 04 '20 14:11 marcusphi

Hi Marcus, Thanks for filing the issue. I'm afraid this project has largely been abandoned as I no longer use Gatling. The plugin is highly dependent on the Gatling version as it's using private gatling apis.

What version are you running in your project?

bmaguireibm avatar Nov 04 '20 14:11 bmaguireibm

Thanks for <nswering anyway. The version is in the issue title: 3.4.1 😄

marcusphi avatar Nov 07 '20 21:11 marcusphi

Oh right, missed that 😂. It would appear that that version has made some breaking changes to some internal API's alright. I'll try to update it at some point to make is compatible, but no idea when I'll get to it. If you want to have a go yourself I set up the project as a fork of the Gatling project, so in theory you should be able to merge with the latest there and that should give you a good idea of what needs to be changed.

bmaguireibm avatar Nov 09 '20 09:11 bmaguireibm

Hello, I have created a pull request where I have updated the Gatling to 3.4.0. I can compile it without errors.

In addition, I have created a simple project to inject traffic with Gatling. Inside my project, I am using this library (gatling-prometheus-datawriter) and I put the gatling.conf with the configuration but I cannot see port 9102 when the injections are running.

data { writers = [console, file, prometheus] }

prometheus { port = "9102" # Port for Prometheus DB to query, must be available. }

What should I add to make it works?

Thank you.

gscaramuzzino avatar Mar 18 '22 10:03 gscaramuzzino