Gathering detailed insights and metrics for @pacovk/k6-executor-cluster
Gathering detailed insights and metrics for @pacovk/k6-executor-cluster
Gathering detailed insights and metrics for @pacovk/k6-executor-cluster
Gathering detailed insights and metrics for @pacovk/k6-executor-cluster
Run K6 loadtests on AWS ephemeral environments.
npm install @pacovk/k6-executor-cluster
Typescript
Module System
Node Version
NPM Version
TypeScript (93.29%)
JavaScript (3.51%)
Shell (2.04%)
Dockerfile (1.15%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
8 Stars
52 Commits
1 Watchers
6 Branches
2 Contributors
Updated on Jul 11, 2025
Latest Version
0.2.0
Package Id
@pacovk/k6-executor-cluster@0.2.0
Unpacked Size
97.42 kB
Size
30.77 kB
File Count
25
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 08, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A comprehensive AWS CDK construct library for deploying and running distributed K6 load tests on AWS infrastructure. This solution provides automated infrastructure provisioning, distributed test execution, real-time monitoring, and comprehensive observability for performance testing at scale.
The solution consists of several key components:
1npm install @pacovk/k6-executor-cluster
or when using yarn
1yarn install @pacovk/k6-executor-cluster
(see example)
1new K6LoadTest(app, "K6LoadTest", { 2 loadTestConfig: { 3 serviceName: "my-app", 4 // ... other config 5 }, 6 infrastructureConfig: { 7 // ... infrastructure config 8 }, 9});
1npx cdk deploy <your-loadtest-stack>
Configure your load test parameters by modifying bin/loadTest.ts
:
1const loadTestConfig: LoadTestConfig = { 2 serviceName: "my-app", // Service name for metrics 3 image: ContainerImage.fromRegistry("grafana/k6"), // K6 Docker image 4 entrypoint: "tests/loadtest.ts", // Path to your test script 5 vus: 10, // Number of virtual users 6 duration: "5m", // Test duration 7 parallelism: 2, // Number of parallel executors 8 repository: { 9 httpsCloneUrl: "https://github.com/user/repo.git", 10 accessTokenSecretName: "github-token", // AWS SSM parameter name 11 vcsProvider: VcsProvider.GITHUB, // or VcsProvider.GITLAB 12 }, 13 secrets: { 14 // Optional: Additional secrets 15 API_KEY: "/path/to/ssm/parameter", 16 }, 17 environmentVars: { 18 // Optional: Environment variables 19 BASE_URL: "https://api.example.com", 20 }, 21 extraArgs: ["--quiet"], // Optional: Any additional K6 arguments 22};
1const infrastructureConfig: InfrastructureConfig = { 2 instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MEDIUM), 3 timeout: Duration.minutes(30), // Maximum test execution time 4 memoryReservationMiB: 1024, // Initial mMemory for K6 container 5 otelVersion: "0.123.0", // OpenTelemetry Collector version 6 vpc: undefined, // Optional: Use existing VPC 7};
Override configuration at deployment time using CDK context:
1# Deploy with custom parameters 2cdk deploy -c vus=50 -c duration=10m -c parallelism=5 3 4# Or set in cdk.json 5{ 6 "context": { 7 "vus": 50, 8 "duration": "10m", 9 "parallelism": 5 10 } 11}
1aws ssm put-parameter \ 2 --name "/loadtest/github-token" \ 3 --value "your-token-here" \ 4 --type "SecureString"
Store any additional secrets your tests need:
1aws ssm put-parameter \ 2 --name "/loadtest/api-key" \ 3 --value "your-api-key" \ 4 --type "SecureString"
Deploy into an existing VPC:
1import { Vpc } from "aws-cdk-lib/aws-ec2"; 2 3const vpc = Vpc.fromLookup(this, "ExistingVpc", { 4 vpcId: "vpc-12345678", 5}); 6 7const infrastructureConfig: InfrastructureConfig = { 8 // ... other config 9 vpc: vpc, 10};
The solution automatically creates a comprehensive CloudWatch dashboard with:
All metrics are published to CloudWatch under the LOADTEST/K6
namespace:
vus
: Number of virtual usershttp_req_duration
: HTTP request durationhttp_reqs
: Number of HTTP requestsdata_received
/data_sent
: Data transfer metricsiteration_duration
: Test iteration timingFailedRequests
: Count of failed requestsThe load test execution follows this workflow:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details.
For questions and support:
Author: pascal.euhus
No vulnerabilities found.
No security vulnerabilities found.