GithubHelp home page GithubHelp logo

akhilputhiry / artillery-engine-lambda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orchestrated-io/artillery-engine-lambda

1.0 1.0 0.0 497 KB

Load test AWS Lambda with Artillery.io

License: Mozilla Public License 2.0

JavaScript 100.00%

artillery-engine-lambda's Introduction

Artillery.io AWS Lambda Plugin

Load test AWS Lambda with Artillery.io

Based on the Kinesis Engine by Shoreditch.

Usage

Important: The plugin requires Artillery 1.5.8-3 or higher.

Install the plugin

# If Artillery is installed globally:
npm install -g artillery-engine-lambda

Use the plugin

  1. Set config.target to the name of the Lambda function
  2. Specify additional options in config.lambda:
    • region - AWS region (default: us-east-1)
  3. Set the engine property of the scenario to lambda.
  4. Use invoke in your scenario to invoke the Lambda function
  5. Specify additional invocation parameters:
    • payload - String or object with the payload to send to the Lambda function
    • invocationType - Lambda invocation type. One of Event, RequestResponse, DryRun
    • logType - One of None, Tail
    • qualifier - Lambda qualifier
    • clientContext - client context to pass to the Lambda function as context
    • target - invocation specific target overriding global default in config.target.

Payload substitution

The Lambda payload can include variable and function placeholders in the form of {{ [VAR_NAME_OR_FUNC_CALL] }}.

For example the payload might include a call to the built-in Artillery functions $randomNumber(min max) or $randomString(length).

Use $contextUid() to get the scenario unique ID in your payload.

Example Script

config:
  target: "lambda_function_name"
  lambda:
    region: "us-east-1"
  phases:
    - arrivalCount: 10
      duration: 1
  engines:
    lambda: {}

scenarios:
  - name: "Invoke function"
    engine: "lambda"
    flow:
      - loop:
        - invoke:
           # data may be a string or an object. Objects
           # will be JSON.stringified.
           clientContext: '{"app": "MyApp"}'
           invocationType: "Event"
           logType: "Tail"
           payload: "Some payload"
           qualifier: "1"
        - think: 1
        count: 100

(See example.yml for a complete example.)

Run Your Script

AWS_PROFILE=dev artillery run my_script.yml

License

MPL 2.0

artillery-engine-lambda's People

Contributors

dependabot[bot] avatar dougmoscrop avatar martinffoster avatar mstn avatar thekiiingbob avatar wzedi avatar zodman avatar

Stargazers

 avatar

Watchers

 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.