Skip to content

justinhj/cloudstate-shopping-cart-loadtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudstate Gatling Loadtest example

What is this?

This is a sample of using Gatling to run a load test against Cloudstate services. Cloudstate is a specification, protocol, and reference implementation for providing distributed state management patterns suitable for Serverless computing.

Getting started

If you deploy the sample shopping cart js-shopping-cart you can use this repository to run a load test against it, that tests various functions.

Running the shopping cart load test

In sbt

gatling-it:testOnly shoppingcart.ShoppingCartSimulation1

Running a load test against your own service

  1. Add the protobuf files for your service API in src/main/protobuf
  2. Copy the folder src/it/scala/shoppingcart and rename it to match your service
  3. Make a gatling test copying the example from ShoppingCartSimulation1.scala that calls your endpoints

You may need to consult the Gatling documumentation to explore its full range of functionality.

Technical notes

This project uses Gatling as a plugin along with grpc to handle the protobuf compilation and gatling-grpc so that we can write Gatling load tests over gRPC instead of HTTP.

Run all simulations

> gatling:test

Run the shopping cart simulation from sbt

> gatling-it:testOnly shoppingcart.ShoppingCartSimulation1

Run the shopping cart simulation at the command line and direct to a particular server...

GATLING_PORT=[PORT] GATLING_USERS=[NUM USERS] GATLING_HOST=[YOUR HOST] sbt gatling-it:testOnly shoppingcart.ShoppingCartSimulation1

List all tasks

> tasks gatling -v

References

https://github.com/gatling/gatling-sbt-plugin-demo https://github.com/phiSgr/gatling-grpc https://medium.com/@georgeleung_7777/a-demo-of-gatling-grpc-bc92158ca808

About

A Gatling load test for the Cloudstate shopping cart over gRPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages