Git Product home page Git Product logo

gatling-stepfunction-extension's Introduction

Gatling AWS Step Function Extension

This is a custom Gatling extension that allows you to perform load testing on AWS Step Functions using the AWS SDK. With this extension, you can start a Step Function execution and wait for it to complete, allowing you to test the performance of your Step Functions under load.

Prerequisites

To use this extension, you'll need the following:

  • Java 8 or later
  • Gatling 3.0
  • AWS SDK

Installation

To use this extension, you can add it as a dependency to your Gatling project. Add the following dependency to your Gatling project's build.gradle:

implementation 'dev.joss:gatling-stepfunction-extension:1.4.0'

For other build tools see the maven central repository overview.

Usage

To use this extension in your Gatling simulation, you can import the dev.joss.gatling.sfn.Predef._ package and use the Sfn DSL to create a new simulation. Here's an example:

import dev.joss.gatling.sfn.Predef._
import dev.joss.gatling.sfn.protocol.SfnProtocol
import io.gatling.core.Predef._
import io.gatling.core.scenario.Simulation

import software.amazon.awssdk.services.sfn.SfnClient

import scala.concurrent.duration.DurationInt
import scala.language.postfixOps

class ExampleSimulation extends Simulation {
  var sfnClient: SfnClient = SfnClient.builder().build()
  var sfnArn =
    "arn:aws:states:eu-west-1:000000000000:stateMachine:some-arn"

  val scn = scenario("SFN DSL test")
    .exec(
      sfn("Start Hello World Execution").startExecution
        .arn(sfnArn)
        .payload("{}")
    )
    .pause(5000.milliseconds)
    .exec(sfn("Check the response").checkSucceeded)

  val requests = scn.inject {
    constantUsersPerSec(100) during (5 minutes)
  }
  setUp(requests).protocols(SfnProtocol(sfnClient))

}

This example creates a new Gatling scenario that starts an execution, waits 5 seconds and then checks the step function has succeeded. For a more applied example, see the example project which tests AWS's Hello World step function using localstack.

License

This extension is licensed under the MIT License. See the LICENSE file for details.

gatling-stepfunction-extension's People

Contributors

jossmoff avatar dependabot[bot] avatar illiliilillliiliillillllillillli avatar

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.