Giter VIP home page Giter VIP logo

jmeter-grpc-plugin's Introduction

JMeter gRPC Plugin

A JMeter plugin supports load test grpc service.

Installation

$ mvn clean install

$ cp target/jmeter-grpc-client-sampler.jar path/to/jmeter/lib/ext

Usage

Note: Please read example first if you want to skip the step by step below

Step 1. Create a *.jar which contains java code generated from *.proto file and copy to jmeter/lib/ext.

Example:

$ cp hello.proto grpc-lib/src/main/proto/

$ cd grpc-lib && mvn package

$ cp target/grpc-lib-0.0.1.jar ../apache-jmeter-5.2/lib/ext/

Step 2. Create test plan :

  • TestPlan > Add > Thread (Users) > Thread Group
  • Thread Group > Add > Sampler > GRPC Client Sampler
  • Config host, port, package, service... (see more)
  • Save your test plan with name <your_test_script>.jmx

Example: hello.jmx

Run

# view all command in jmeter
$ jmeter/bin/jmeter -h

# run load test
$ jmeter/bin/jmeter -n -t <your_test_script>.jmx -l <result_file>.csv

# generate report
$ jmeter/bin/jmeter -g <result_file>.csv -o <report>

Report

Acknowledgements

Thanks to @A1Darkwing (Thanh Tran), @anhldbk (Anh Le), @VoxT (Thieu Vo) who dedicated to help me review and refactor the source code of project.

If you would like to work with the simple request by json, see jmeter-grpc-request

jmeter-grpc-plugin's People

Contributors

anhldbk avatar ckstettler avatar dependabot[bot] avatar thoainguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jmeter-grpc-plugin's Issues

Jmeter -GRPC -Issue

Hi Team -Thanks for code.

I had followed same steps and able to enable GRPC protocol in Jmeter.

Now my issues is ,I am unable to run GRPC sampler which you mentioned getting attached issue. Can you please help me here. Please find attachment

POC_GRPC.pdf

Error message

2020-05-14 11:36:42,759 ERROR v.z.j.g.u.GrpcUtils: Failed to load metadata:
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Bearer': was expecting ('true', 'false' or 'null')
at [Source: (String)"{"Authorization": Bearer Token"}"; line: 1, column: 25]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804) ~[jackson-core-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:703) ~[jackson-core-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2853) ~[jackson-core-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1899) ~[jackson-core-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextFieldName(ReaderBasedJsonParser.java:968) ~[jackson-core-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:500) ~[jackson-databind-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:364) ~[jackson-databind-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:29) ~[jackson-databind-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4014) ~[jackson-databind-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3005) ~[jackson-databind-2.9.10.jar:2.9.10]
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.createHeaderMap(GrpcUtils.java:123) [jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getChannel(GrpcUtils.java:150) [jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:76) [jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:89) [jmeter-grpc-client-sampler.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) [ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Thread.java:832) [?:?]
2020-05-14 11:36:42,871 ERROR v.z.j.g.c.GrpcClientSampler: Call initGrpcClient has thrown an exception:
java.lang.ClassNotFoundException: io.grpc.examples.helloworld.GreeterGrpc

What is the license?

Hi, base on this example code, I changed the implementation a bit and then want to use it in our production codebase. I am wondering what is the license for this example code.

java.lang.NoClassDefFoundError: Could not initialize class proto.SigningProto

I am getting the following error, please let me know what may be wrong:

2020-05-27 18:06:21,909 INFO j.g.c.GrpcClientSampler: Created GrpcClientSampler
2020-05-27 18:06:21,910 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2020-05-27 18:06:21,910 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2020-05-27 18:06:21,912 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\bcprov-jdk15on-1.60.jar to classpath
2020-05-27 18:06:21,912 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\grpc-api-1.29.0.jar to classpath
2020-05-27 18:06:21,912 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\grpc-netty-1.29.0.jar to classpath
2020-05-27 18:06:21,912 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\grpc-netty-shaded-1.29.0.jar to classpath
2020-05-27 18:06:21,912 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\grpc-okhttp-1.29.0.jar to classpath
2020-05-27 18:06:21,913 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\jmeter-grpc-plugin.jar to classpath
2020-05-27 18:06:21,913 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Downloads\apache-jmeter-5.2.1\lib\ext\lombok-1.18.10.jar to classpath
2020-05-27 18:06:21,913 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Documents\Bhala\EHRData\bitbucket\jmeter\src\main\resources\config.properties to classpath
2020-05-27 18:06:21,913 INFO o.a.j.t.TestPlan: added C:\Users\b.rajalakshmi\Documents\Bhala\EHRData\bitbucket\jmeter\src\main\resources\jmeter\grpc\utils\GrpcClientSamplerResources.properties to classpath
2020-05-27 18:06:21,913 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, local)
2020-05-27 18:06:22,040 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2020-05-27 18:06:22,040 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2020-05-27 18:06:22,040 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2020-05-27 18:06:22,040 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2020-05-27 18:06:22,040 INFO j.g.c.GrpcClientSampler: Created GrpcClientSampler
2020-05-27 18:06:22,041 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2020-05-27 18:06:22,041 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2020-05-27 18:06:22,042 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2020-05-27 18:06:22,213 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2020-05-27 18:06:22,213 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[Thread Group 1-1,6,main]
java.lang.NoClassDefFoundError: Could not initialize class proto.SigningProto
at proto.GetPublicKeyRequest.internalGetFieldAccessorTable(GetPublicKeyRequest.java:212) ~[jmeter-grpc-plugin.jar:?]
at com.google.protobuf.GeneratedMessageV3.getDescriptorForType(GeneratedMessageV3.java:133) ~[jmeter-grpc-plugin.jar:?]
at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:344) ~[jmeter-grpc-plugin.jar:?]
at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:334) ~[jmeter-grpc-plugin.jar:?]
at com.google.protobuf.TextFormat$Printer.printToString(TextFormat.java:519) ~[jmeter-grpc-plugin.jar:?]
at com.google.protobuf.AbstractMessage.toString(AbstractMessage.java:111) ~[jmeter-grpc-plugin.jar:?]
at jmeter.grpc.client.ClientRecorder.(ClientRecorder.java:14) ~[jmeter-grpc-plugin.jar:?]
at jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:88) ~[jmeter-grpc-plugin.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) ~[ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
2020-05-27 18:06:22,214 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2020-05-27 18:06:22,215 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)

please find attached the screenshot of jmeter and the JAR file used for reference.
jmeter-grpc-plugin.zip
issue

Unable to resolve service by invoking protoc

On MacBookPro M1 chipset, running macOS Monterey Version 12.4

I cannot execute grpc requests because the baked-in protoc (protobuf compiler) will not execute.

Even when I try building jmeter-grpc-plugin from source, off the master branch, and using:

  • Java 8
  • Maven

your internal unit-tests fail for the same reason:

The exception was thrown with the wrong message: expected "Caught exception while waiting for rpc" but got "Unable to resolve service by invoking protoc"

mvn -v
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Got java.lang.RuntimeException: ManagedChannel allocation site, Please Help

Hi, I use your plugin and when I test always got this, I still using gui, when got this error, still can hit another
But when I use cmd, always got this error so I cannot load test

SEVERE: ~* Channel ManagedChannelImpl{logId=1, target=10.27.2.204:6790} was not shutdown properly!!! *~
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.(ManagedChannelOrphanWrapper.java:94)
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:52)
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:43)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:518)
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getChannel(GrpcUtils.java:180)
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:56)
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:69)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:748)

protoc not found

Hello

I'm new to JMeter and GRPC.

I am trying to run a simple load test on a GRPC. I "designed" the plan on my Windows desktop and run it from a docker image I have created composed of JMeter 5.5 and your plugin.

On Windows, everything works fine, and my GRPC respond correctly when I make calls on it ; however when I try to run it on my docker image, I have the following error :

protoc-jar: executing: [/root/protocjar2836171193531476824/bin/protoc.exe, /data/plans/various-net-rest/protos/definitions/groups.proto, /data/plans/various-net-rest/protos/definitions/orgunits.proto, /data/plans/various-net-rest/protos/definitions/idecsi.proto, /data/plans/various-net-rest/protos/definitions/users.proto, /data/plans/various-net-rest/protos/definitions/bcl.proto, -I/data/plans/various-net-rest, -I/tmp/polyglot-well-known-types6152673638723248615, -I/data/plans/various-net-rest/protos/definitions, --descriptor_set_out=/tmp/descriptor7298494316876722494.pb.bin, --include_imports]
protoc-jar: caught exception, retrying: java.io.IOException: Cannot run program "/root/protocjar2836171193531476824/bin/protoc.exe": error=2, No such file or directory

It seems JMeter tries to extract protoc and fails. I've check on my root folder (inside the container) ; a lot of folders have been created but are empty :

bash-5.0# ls -la /root
total 592
drwx------    1 root     root         12288 Aug 29 12:26 .
drwxr-xr-x    1 root     root          4096 Aug 26 19:02 ..
drwxr-xr-x    3 root     root          4096 Aug 26 19:05 .java
drwxr-xr-x    3 root     root          4096 Aug 26 19:05 .xmlresolver.org
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1054210220643666033
drwxr-xr-x    3 root     root          4096 Aug 29 12:26 protocjar1081656123494679070
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1089281204173412717
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1114364354043061131
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1134672610318948229
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1172626416833290321
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1223208108087094134
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1232693709059410816
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1260332253508817565
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1264778688547381355
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1386086665470300468
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1449530617661051350
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1496269232531476479
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1540482937336149640
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1590485306313282116
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1618616069122318440
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1623098157640015427
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1664865795063888450
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1669475240043161766
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1707075011610564955
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1709591080239414703
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1778303094870944149
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar1878993455605160081
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2034346621181491212
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2106859008023225578
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar242551655593392514
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar243632539110690730
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2506925832112169634
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2583122099460856004
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2691221759204620640
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2733455136926175725
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2780475174038679529
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar2869931571714916886
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3015123906820178517
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3045776301432332179
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3114683371406970261
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3144485781043123920
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3155121317356815876
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3191360066612902157
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar321562358659344195
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3250191847640920589
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3283940336472176313
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3313943695562098098
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3354555365357757256
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3420372486352804567
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3576292858546711492
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3621218243137717819
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3630854805995288999
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar365831272505823174
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3664340628592229079
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3710636514533506847
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3852408437458857524
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3924097895725999231
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3927591239970303828
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar3948458543881489478
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4044650413542618403
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4054383577064371598
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4102151736629967346
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4161577444500283862
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar419735281032981219
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4310586350124852317
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4336835803840794721
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4395559507666532741
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar457828673721173097
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4640265267978412539
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4671837626054415733
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4697286433514108387
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4856216694880841200
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4872409807639073408
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar4894803778292145090
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5094746039036437318
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5124055277314159222
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5153524229866043084
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5192084314039628128
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5229118292170851443
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5241694007773917464
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5355813502918316877
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5365594003576639208
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5414033862469173657
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5416435204943337719
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5583203317703000164
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5650910980155130334
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5838044162675796622
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar5877799402706014925
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6003178606191828344
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6050610456984547220
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6163295099905306192
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6181899192750505069
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6190602713284064702
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6210960580234131445
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar625371809549746054
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6276830892355356187
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6410575272853645980
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6431642531826122293
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6527956140073416111
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6649937652308925438
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6675885953660925697
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6697972143999687130
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6777815885894476060
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar681132467248344173
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6823871841609013683
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6845378200459299573
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6892906776619240183
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar6902785029200315244
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7126910146497554603
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7133980788893587565
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7151240730361083719
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7166287483440667436
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7182453750413314467
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7273201974551591132
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7370219170333339583
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7464116743858685913
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7472812962784843850
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7570987526320710874
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7592041012732292143
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7649856451818995265
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7767637067305376911
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7796094961125101293
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7849890528917453671
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7888301976616466083
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar788855230829598645
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7908401646960832858
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar7995336769913269255
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8116987583992325509
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8128419829351246496
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8137201499832424017
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8145681470668343811
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8147039162178037902
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8149923457472612196
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8229930901450300916
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8241319938476525041
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar830005262355985283
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8570664122024261737
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8623534296579070161
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8719119486192403267
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8800096361573052204
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar8800188615106822802
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar892901950674721167
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar9007657700832241981
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar9065292837087329990
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar9119602616069626877
drwxr-xr-x    2 root     root          4096 Aug 29 12:26 protocjar925979855443337382

Do you know how to fix this issue ?

Thanks

Where to set gRPC parameters in JMeter

Hi,
I have an issue with gRPC response:
Response message:Exception: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 56924753

As I understand I should increase maxInboundMessageSize parameter, but I have no idea where to place it in JMeter.

Thanks in advance.
Leon

Compatibility with older JMeter

Hello,

I would like to ask if this plugin could work with JMeter version 2.9? I've tried to add it, but I get the following error:
2020/06/04 12:50:39 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoSuchMethodError: org.apache.jmeter.samplers.SampleResult.setSentBytes(J)V
at vn.zalopay.jmeter.grpc.client.ClientRecorder.(ClientRecorder.java:18)
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:93)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:748)

Regards
Miky

Bidirectional Support?

I'm unable to tell if I'm making a mistake, or if this is unable to test bidirectional streaming

Can we use full path of the GRPC service in the GRPC Request

Hi @thoainguyen @anhldbk @ckstettler
Thank you for this Plugin in the first place.
I am able to create the GRPC request in Jmeter using this plugin. However the developers of the GRPC service that I am testing have Designed the service in such a way that we need to send the full path of the service instead of the selecting the service from the "Full Method" Drop down (current behaviour in the plugin). Is this something that can be accomplished with this plugin.. I wanted to upload a screenshot of what I am referring to. But I am unable to .Please advise
Thank you Jagan

NoSuchMethodError on com.google.common.base

Dear All,

I've tried to use this plugin, but failed to do so.
A basic example on Mac OS X (10.15.4):

  • download repo
  • execute mvn clean install in root folder with java 1.8.232 (Zulu)
  • move jmeter-grpc-client-sampler.jar to {jmeter_home}/lib/ext
  • go to docs/example/grpc-lib
  • put my measurements.proto into src/main/proto
syntax = "proto3";

option java_multiple_files = true;
option java_package = "ch.zhaw.grpc";
option java_outer_classname = "Measurements";
option objc_class_prefix = "HLW";

package ch.zhaw.grpc;

import "google/protobuf/timestamp.proto";

service MeasurementsService {
  rpc send (MeasurementsRequest) returns (MeasurementsReply) {}
}

message MeasurementsRequest {
  google.protobuf.Timestamp timeValue = 1;
  int32 value = 2;
}

message MeasurementsReply {
  string timeValue = 1;
  int32 value = 2;
}
  • execute mvn clean install with java 1.8.232 (Zulu)
  • move grpc-lib-0.0.1.jar to {jmeter_home}/lib/ext

Now make a Test Plan in order to try a GRPC Sampler, which fails due to missing Method. The funny thing is, if I execute in the very same session once again, I get an other error, namely

First try
image

Second try (in the same session, just seconds after
image

Best regards
Aleks

Version upgrade?

Are you still supporting this repo? I have made some modification to allow support for

io-grpc dependencies to : 1.43.2
google.protobuf to : 3.19.1

I would be happy to submit a PR if you are interested?

Keep alive configuration

Hello, first of all, thanks for this amazing plugin. I have been using it for about 3 months now and it rocks!

Having said that, I have a question regarding how I can configure the time out values of the GRPC ManagedChannel used to send the GRPC requests.

  • One of my use cases is to send some large requests to a GRPC service that may take more than 60 seconds to complete.
  • At first, I thought on just configuring the timeout parameter of the client sampler with a proper value ~120K milliseconds
  • Nevertheless, even with that configuration in place, those big requests get cancelled at around 60 seconds of start with the following Exception: Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
  • After doing some troubleshooting, I wrote a simple GRPC Kotlin client to try to send those same requests. The basic configuration of the ManagedChannel is as follows:
channel = NettyChannelBuilder.forAddress(SERVICE_HOST, SERVICE_PORT)
            .useTransportSecurity()
            .sslContext(
                GrpcSslContexts.forClient().trustManager(File(CERT_PATH)).build()
            )
            .keepAliveWithoutCalls(true)
            .keepAliveTime(30, TimeUnit.SECONDS)
            .keepAliveTimeout(30, TimeUnit.SECONDS)
            .build()
        determinationAPIBlockingStub = DeterminationAPIGrpc.newBlockingStub(channel)
  • As you can see, I specified keepAliveWithoutCalls as true, keepAliveTime with 30 seconds and keepAliveTimeout with 30 seconds as well
  • Previous configuration allowed the channel to be "idle" for more than 60 seconds, therefore, succeeding the request call, so I think this might be the issue of the connection being closed
  • Exploring the GrpcClientSampler.java class, I noticed that there is no way of specifying keep alive values when creating the channel
public static ManagedChannel getChannel(GrpcClientSampler sampler) throws SSLException {
    Map<String, String> headerMap = createHeaderMap(sampler.getMetaData());

    ManagedChannelBuilder builder = NettyChannelBuilder.forAddress(sampler.getHostname(), sampler.getPort())
        .intercept(new GrpcClientInterceptor(headerMap, sampler.getTimeout()));

    if (!sampler.isUseSsl()) {
      builder = builder.usePlaintext();
    } else if (!StringUtils.isBlank(sampler.getCertFile())) {
      // build out a managed channel that can accept the ssl cert file
      // Get the file and verify it exists
      File certFile = new File(sampler.getCertFile());
      if (!certFile.exists()) {
        LOGGER.error("The cert file passed in does not exist at: ", sampler.getCertFile());
      }

      // build the client side ssl context with the cert
      SslContext sslContext = GrpcSslContexts.forClient().trustManager(certFile).build();

      // add the ssl context to the builder
      builder = ((NettyChannelBuilder) builder).sslContext(sslContext);
    }
    return builder.build();
  }

So, I was wondering if there is a workaround or some recommended approach on how to configure the sampler channel to use specific keep alive configuration values.

Thanks in advance.

java.lang.ClassNotFoundException: io.grpc.examples.helloworld.GreeterGrpc

Dear All,

I've tried to use jmeter-grpc-plugin and faced issue below.

  • Environment:
    • server: ./build/install/examples/bin/hello-world-server(Nothing changed)
    • proto: helloworld.proto(Nothing changed)

2020-04-03 05:04:47,337 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2020-04-03 05:04:47,341 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2020-04-03 05:04:47,380 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2020-04-03 05:04:47,381 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2020-04-03 05:04:47,385 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, local)
2020-04-03 05:04:47,676 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2020-04-03 05:04:47,676 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2020-04-03 05:04:47,677 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2020-04-03 05:04:47,677 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2020-04-03 05:04:47,677 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2020-04-03 05:04:47,678 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2020-04-03 05:04:47,679 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2020-04-03 05:04:47,683 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2020-04-03 05:04:47,711 ERROR v.z.j.g.c.GrpcClientSampler: Call initGrpcClient has thrown an exception:
java.lang.ClassNotFoundException: io.grpc.examples.helloworld.GreeterGrpc
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_241]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_241]
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getBlockingStub(GrpcUtils.java:193) ~[jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:57) [jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:69) [jmeter-grpc-client-sampler.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) [ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
2020-04-03 05:04:47,713 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'GrpcClientSampler'.
java.lang.NullPointerException: null
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:72) ~[jmeter-grpc-client-sampler.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) ~[ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) [ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
2020-04-03 05:04:47,713 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2020-04-03 05:04:47,714 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2020-04-03 05:04:47,716 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2020-04-03 05:04:47,716 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)

Could you let me know how to resolve this issue?

Sincerely,

java.lang.NoSuchMethodException: com.***.payment.integrator.v1.BraintreeClientImplGrpc.newBlockingStub(io.grpc.Channel)

Hi,
Thanks for sharing this implementation. I am trying to make this work for one grpc based service and getting the below exception. Can you please help in troubleshooting this error?

2021-04-27 20:22:30,826 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,832 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,833 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2021-04-27 20:22:30,833 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2021-04-27 20:22:30,834 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2021-04-27 20:22:30,974 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2021-04-27 20:22:30,974 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,975 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2021-04-27 20:22:30,975 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2021-04-27 20:22:30,975 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2021-04-27 20:22:30,978 ERROR v.z.j.g.c.GrpcClientSampler: Call initGrpcClient has thrown an exception: 
java.lang.NoSuchMethodException: com.***.payment.integrator.v1.BraintreeClientImplGrpc.newBlockingStub(io.grpc.Channel)
	at java.lang.Class.getMethod(Class.java:2122) ~[?:?]
	at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getBlockingStub(GrpcUtils.java:183) ~[jmeter-grpc-client-sampler.jar:?]
	at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:80) [jmeter-grpc-client-sampler.jar:?]
	at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:92) [jmeter-grpc-client-sampler.jar:?]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) [ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
	at java.lang.Thread.run(Thread.java:832) [?:?]
2021-04-27 20:22:30,979 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'GRPC Client Sampler BIS 3'.
java.lang.NullPointerException: null
	at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:95) ~[jmeter-grpc-client-sampler.jar:?]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) ~[ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
	at java.lang.Thread.run(Thread.java:832) [?:?]
2021-04-27 20:22:30,980 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2021-04-27 20:22:30,980 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2021-04-27 20:22:30,980 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2021-04-27 20:22:30,980 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

Screen Shot 2021-04-27 at 8 21 45 PM

Regards
Debayan

Remote Testing?

Is there a way to run tests on remote jmeter-servers?

I believe I need to pass in the "Proto Root Directory" and "Library Directory" in the properties file on the remote, but don't see any documentation on how.

When trying to run a remote test I get the following:

`
WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (/path/to/jmeter-grpc-request-1.1.2.jar) to field java.nio.Buffer.address

WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release
`

Thanks for the plug in and looking at this issue.

Disable SSL verifications in netty by default

Load testing with ssl enabled is usual in test environments that use self signed and not well crafted certs.
The idea is to bypass checking the validity of the certs by default.

error on init

Hi
i get the follow error on connection to my grpc server :

java.lang.NoClassDefFoundError: scalapb/GeneratedMessage
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_251]
at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[?:1.8.0_251]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_251]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[?:1.8.0_251]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_251]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_251]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_251]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_251]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_251]
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_251]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_251]
at java.lang.Class.privateGetMethodRecursive(Class.java:3048) ~[?:1.8.0_251]
at java.lang.Class.getMethod0(Class.java:3018) ~[?:1.8.0_251]
at java.lang.Class.getMethod(Class.java:1784) ~[?:1.8.0_251]
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getBlockingStub(GrpcUtils.java:184) ~[jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:80) ~[jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:92) ~[jmeter-grpc-client-sampler.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) ~[ApacheJMeter_core.jar:5.3]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
Caused by: java.lang.ClassNotFoundException: scalapb.GeneratedMessage
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_251]
... 24 more

Stale files under C:\Users\{my_user}\AppData\Local\Temp\ with Open Model Thread Group clutter Hard Drive

Script

Open Model Thread Group (bundled with JMeter 5.5) -> rate (180/min) random_arrivals(720min)
A single Unary request towards a gRPC service
SSL/TLS - enabled
Disable SSL/TLS Cert Verification - enabled
Short JSON payload
I cannot share it, because I work in regulated business environment

What happens?

I start the script in GUI mode, with low-thread-count and within a few minutes, I see that the hard drive space is going down rapidly...
Inspecting with WinDirStat, I notice there are a lot of folders/files like the ones bellow being created:

Group 1: C:\Users{my_user}\AppData\Local\Temp\protocjar{variable_long_number}\bin\protoc.exe (~7.8MB)
Group 2: C:\Users{my_user}\AppData\Local\Temp\polyglot-well-known-types{variable_long_number}\google\protobuf*.proto (~104kB)
Group 3: C:\Users{my_user}\AppData\Local\Temp\descriptor{variable_long_number}.pb.bin (~33kB)

All folders in Group 1 and Group 2 contain exactly the same files.

These folders/files are here until JMeter is closed, but, given that JMeter's way of operating the Open Model Thread Group implies opening/closing many threads, you have many stale such folders - doing 1k requests, eats up about ~8-10GB. This is not the best situation, since I'd need to soak run this for days and days at 5-10/sec rates.
I have yet to test it in a Linux environment (container as well), though.

These folders/files are also created with other types of Thread Groups, however I noticed them being stale with this one only.
Note: Issue reproduces with JMeter in NON-GUI mode

Versions

Apache JMeter 5.5
jmeter-grpc-plugin v1.2.5.1, but also tested with 1.2.6
OpenJDK 17 (also tested with 11)
Windows 10 v1909

Error - java.lang.NoClassDefFoundError: io/grpc/stub/AbstractStub$StubFactory

Hello,

We are trying to add this plugin to JMeter, but encounter an error, could you please help with it?
We did everything as in the manual:

  • built the .jar for the plugin
  • built the .jar for the hello world project
  • copied tha .jar-s to lib/ext folder
  • created a test plan.

The error is the following:
java.lang.NoClassDefFoundError: io/grpc/stub/AbstractStub$StubFactory
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_251]
at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[?:1.8.0_251]
at java.lang.Class.privateGetMethodRecursive(Unknown Source) ~[?:1.8.0_251]
at java.lang.Class.getMethod0(Unknown Source) ~[?:1.8.0_251]
at java.lang.Class.getMethod(Unknown Source) ~[?:1.8.0_251]
at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getBlockingStub(GrpcUtils.java:164) ~[jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:77) ~[jmeter-grpc-client-sampler.jar:?]
at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:89) ~[jmeter-grpc-client-sampler.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) ~[ApacheJMeter_core.jar:5.3]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.lang.ClassNotFoundException: io.grpc.stub.AbstractStub$StubFactory
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_251]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_251]
... 13 more

I get an error says "grpcCallMethod Exception"

I follow the readme and get an error like this
2020-03-20 21:57:45,712 INFO o.j.g.c.GrpcClientSampler: grpcCallMethod
2020-03-20 21:57:45,712 ERROR o.j.g.c.GrpcClientSampler: grpcCallMethod Exception
java.lang.NoSuchMethodException: greet.GreeterGrpc$GreeterBlockingStub.SayHello(greet.HelloRequest)
how can I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.