bmaguireibm / gatling-prometheus-datawriter

This repo holds code to add a Prometheus DataWriter to export real time results to a Prometheus db from a running https://gatling.io test.
Apache License 2.0
20 stars 14 forks source link

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

Open marcusphi opened 4 years ago

marcusphi commented 4 years ago

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]
bmaguireibm commented 4 years ago

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?

marcusphi commented 4 years ago

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

bmaguireibm commented 4 years ago

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.

gscaramuzzino commented 2 years ago

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.