All Projects → phiSgr → gatling-grpc

phiSgr / gatling-grpc

Licence: Apache-2.0 License
A Gatling load test plugin for gRPC

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to gatling-grpc

meshRPC
Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.
Stars: ✭ 69 (-20.69%)
Mutual labels:  grpc
protobuf-compiler
online protobuf compiler
Stars: ✭ 24 (-72.41%)
Mutual labels:  grpc
gnmi-map
gNMI service map
Stars: ✭ 23 (-73.56%)
Mutual labels:  grpc
mnemosyne
Session management service with RPC API based on protobuf.
Stars: ✭ 15 (-82.76%)
Mutual labels:  grpc
grpcoin
API-driven cryptocurrency paper trading game. Write a bot and play!
Stars: ✭ 53 (-39.08%)
Mutual labels:  grpc
Search Ads Web Service
Online search advertisement platform & Realtime Campaign Monitoring [Maybe Deprecated]
Stars: ✭ 30 (-65.52%)
Mutual labels:  grpc
pulseha
PulseHA is a active-passive high availability cluster daemon that uses GRPC and is written in GO.
Stars: ✭ 15 (-82.76%)
Mutual labels:  grpc
upper
Upper is a open source back-end framework based on the Dart language.
Stars: ✭ 39 (-55.17%)
Mutual labels:  grpc
ddns
Simple restful dynamic DNS service
Stars: ✭ 25 (-71.26%)
Mutual labels:  grpc
engine
a plugin based grpc framework
Stars: ✭ 16 (-81.61%)
Mutual labels:  grpc
dalal-street-server
Server for Pragyan's Dalal Street
Stars: ✭ 65 (-25.29%)
Mutual labels:  grpc
aip-go
Go SDK for implementing resource-oriented gRPC APIs.
Stars: ✭ 47 (-45.98%)
Mutual labels:  grpc
grpcdebug
grpcdebug is a command line interface focusing on simplifying the debugging process of gRPC applications.
Stars: ✭ 25 (-71.26%)
Mutual labels:  grpc
tron-rpc
波场钱包节点对接
Stars: ✭ 58 (-33.33%)
Mutual labels:  grpc
vtprotobuf
A Protocol Buffers compiler that generates optimized marshaling & unmarshaling Go code for ProtoBuf APIv2
Stars: ✭ 418 (+380.46%)
Mutual labels:  grpc
httpbook
Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
Stars: ✭ 18 (-79.31%)
Mutual labels:  grpc
pcap-processor
Read and process pcap files using this nifty tool
Stars: ✭ 36 (-58.62%)
Mutual labels:  grpc
citadel
Turn an arbitrary command into a Kubernetes Key Management Service GRPC server
Stars: ✭ 15 (-82.76%)
Mutual labels:  grpc
ldhcpd
Light DHCPd -- a DHCP server with a small feature set and a remotely programmable control plane
Stars: ✭ 49 (-43.68%)
Mutual labels:  grpc
nameko-grpc
GRPC Extensions for Nameko
Stars: ✭ 51 (-41.38%)
Mutual labels:  grpc

Gatling-gRPC

A Gatling load test plugin for gRPC.

Usage

Because of gRPC's need of code generation, I assume you are running the tests using the SBT plugin. For a quickstart guide, see this Medium article.

For usage with the Gradle Gatling plugin, see this example project.

To use this library, add this library to the test dependencies along with the two required by Gatling.

libraryDependencies ++= Seq(
  "io.gatling.highcharts" % "gatling-charts-highcharts" % gatlingVersion % "test",
  "io.gatling" % "gatling-test-framework" % gatlingVersion % "test",
  "com.github.phisgr" % "gatling-grpc" % "0.12.0" % "test"
)
enablePlugins(GatlingPlugin)

For setting up the code generation, see the documentation in ScalaPB.

If your protobuf files are in src/test/protobuf instead of src/main/protobuf, change Compile to Test.

PB.targets in Test := Seq(
  scalapb.gen() -> (sourceManaged in Test).value
)

To make a gRPC call:

exec(
  grpc("my_request")
    .rpc(ChatServiceGrpc.METHOD_GREET)
    .payload(GreetRequest(
      username = "myUserName",
      name = "My name"
    ))
)

For a complete demo and various examples including the proper syntax to include session attributes (e.g. from a feeder, or saved in a check), see GrpcExample in test.

For more complex manipulations with session attributes and protobuf objects, like repeated fields and map fields, see the unit test.

Dynamic Payload

There are helper methods in gatling-grpc for generating dynamic ScalaPB objects with Lenses, as demonstrated in the example linked above. It makes uses of extension methods, and requires importing com.github.phisgr.gatling.pb._.

If you want to use Java Protobuf classes, you can use the gatling-javapb library.

If the expressive power of these two plumbing tools are not enough, you can always resort to writing a lambda. Because an Expression[T]is just an alias for Session => Validation[T].

Logging

In logback.xml, add
<logger name="com.github.phisgr.gatling.grpc" level="DEBUG" />
to log the requests that are failed; or set the level to TRACE to log all gRPC requests.

Development

sbt clean coverage test gatling:test coverageReport for a coverage report.
sbt clean bench/clean 'bench/jmh:run -i 3 -wi 3 -f10 -t1 -prof gc' for JMH tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].