1.0.19 • Published 5 years ago

artillery-engine-lambda v1.0.19

Weekly downloads
19
License
MPL-2.0
Repository
github
Last release
5 years ago

Artillery.io AWS Lambda Plugin

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

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago