
chatwork/gatling-ecs-clientGatling ECS client是一款一站式工具,旨在简化在AWS ECS(Elastic Container Service)上运行Gatling性能测试模拟并在Amazon S3中生成测试报告的流程。该工具集成了任务编排、日志存储和报告生成功能,提供了在AWS环境中执行Gatling测试的完整解决方案。
适用于需要在AWS云环境中执行性能测试的团队和个人,特别是:
运行Gatling场景需满足以下条件:
Cmd必须包含以下操作:
需通过CloudFormation创建以下两个ECS任务定义:
1. 运行器任务(runner)
gatling-runner2. 报告器任务(reporter)
gatling-s3-reporterchatwork/gatling-s3-reporter:0.1.1配置示例:可复制并修改samples/cloudformation/gatling-ecs.template模板创建CloudFormation堆栈。
工具执行需提供JSON配置文件,结构如下:
json{ "taskDefs": { // 脚本使用的任务定义 "runner": {}, // [必填] 运行器任务定义 "reporter": {} // 报告器任务定义 }, "awsSubnet": "", // [必填] 与任务关联的AWS子网ID "awsSecurityGroup": "", // 与任务关联的AWS安全组ID "s3LogPrefix": "", // S3日志存储前缀,默认自动生成executionId目录;如需分组可指定如"test_group/" "reportParams": { "hostUrl": "" // 报告基础URL,设置后输出格式:`[hostUrl]/[execution_id]/index.html` }, "chatworkNotificationParams": { // Chatwork通知参数(需设置CHATWORK_API_TOKEN环境变量) "roomId": "", // Chatwork房间ID "message": "" // 通知消息内容 }, "tasks": { "runner": {}, // [必填] 运行器任务属性 "reporter": {} // 报告器任务属性 } }
核心参数说明:
taskDefs.runner/taskDefs.reporter (TaskDef):任务定义配置
json{ "stackName": "", // [必填] CloudFormation堆栈名称 "taskName": "" // [必填] 堆栈输出中的任务定义名称 }
tasks.runner/tasks.reporter (TaskProp):任务执行属性
json{ "executionIdEnvName": "", // [报告器必填] 容器中使用execution_id的环境变量名 "count": 1, // 任务实例数量 "environment": {} // 环境变量键值对 }
sh# 使用IAM凭证 $ docker run -it --rm \ -v ~/.aws/credentials:/root/.aws/credentials:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2 # 使用SSO认证 $ aws sso login $ docker run -it --rm \ -v ~/.aws:/root/.aws:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2
sh# 使用IAM凭证与特定配置文件 $ docker run -it --rm \ -e AWS_PROFILE="xxxxxxx" \ -v ~/.aws/credentials:/root/.aws/credentials:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2 # 使用SSO与特定配置文件 $ aws sso login --profile "xxxxxxx" $ docker run -it --rm \ -e AWS_PROFILE="xxxxxxx" \ -v ~/.aws:/root/.aws:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2
sh$ export CHATWORK_API_TOKEN=xxxxxxxxxxxxxxxxxxx # 使用IAM凭证与Chatwork通知 $ docker run -it --rm \ -e AWS_PROFILE="xxxxxxx" \ -e CHATWORK_API_TOKEN \ -v ~/.aws/credentials:/root/.aws/credentials:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2 # 使用SSO与Chatwork通知 $ aws sso login --profile "xxxxxxx" $ docker run -it --rm \ -e AWS_PROFILE="xxxxxxx" \ -e CHATWORK_API_TOKEN \ -v ~/.aws:/root/.aws:ro \ -v "$PWD"/gatlingEcs.json:/usr/src/app/setting.json \ chatwork/gatling-ecs-client:0.1.2



manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务