Replies: 2 comments
-
Hello @laurelleb, First off, it's worth differentiating between 2 things:
In this case, it sounds like you want option 2, so our documentation for AWS Lambda doesn't apply here, as that refers to case 1. However, I'm a little bit confused, because your function code Now, onto your questions 👇 .
We don't directly support Lambda as an engine. The engine you linked to is a third-party engine created by the community, which may or may not still work (it sounds like it's archived, so it might not work). You can try to use it and see if it works. Another alternative would be to write your own custom function that invokes the Lambda function using the AWS SDK. I do something similar in this example - in that case, I use a custom function to call a soap server using the
There is no way to guarantee it stops at exactly 15 minutes. You can define your phases to be close to that, but it can take slightly less or slightly more for it to actually conclude. On a side note I imagine you're interested in that due to the Lambda 15 minute timeout. I'm not sure that applies here, because that timeout is for each invokation, and each VU would be invoking a Lambda function in this case, so it would take however long the application code needs to run?
Yes, you can make variables in the script for this, and you can even use the |
Beta Was this translation helpful? Give feedback.
-
Hi! Thanks for the reply. You are right, I want to run tests inside AWS lambda using artillery's distributed load testing support. I was able to get the final version of my test to run using the 3rd party engine. Right now, it meets my needs, but I will likely go down the custom function path in a few months. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
I am trying to invoke a lambda function by name. I do not have access to the function URL and cannot call the lambda that way. I found an engine called artillery-engine-lambda, but it is archived. It can be found here: (https://github.com/orchestrated-io/artillery-engine-lambda)
I have a few questions:
Are there other ways to invoke the lambda name instead of the URL?
Is there a way to add a stop condition to this script? I am not sure if some of the other parameters from say, HTTP, would work here. I would like the test to last no more than 15 minutes. I see that under the AWS Lambda doc pagem that the test duration should last no longer than 15 minutes, but how can I make sure that my test stops at 15 min? Does it stop automatically? And if not, what do I need to add to my script to exit the test before 15 min?
Finally, I need to be able to parameterize the target lambda name. I have multiple lambdas I need to change based on the environment build of Jenkins. For example, devtest-lambda and prod-lambda. Would it be as simple as making a variable in the yaml called {{ $lambda-name }} and making that the target variable? Or would I need to call it in my "artillery run" line of the Jenkins file. I am not a developer so I am a bit confused on this.
For deeper context - the following code is the yaml script that should invoke the lambda and deliver a payload ( key/value pair dictionary removed for confidentiality).
This load test is a stage within a Jenkins build.
The function that runs the yaml script:
I did run a test with npm install artillery too but it wouldn't run without artillery-engine-lambda too. I think this is because of how I have written my yaml script.
I would appreciate any help. Thanks in advance. Let me know if you need more info to help.
Beta Was this translation helpful? Give feedback.
All reactions