artillery-engine-lambda
Load test AWS Lambda with Artillery.io
Last updated 3 years ago by wzedi .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install artillery-engine-lambda 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.19                                ...           latest (9 months ago)

20 Versions

  • 1.0.19                                ...           9 months ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           3 years ago
  • 1.0.13                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |