Gatling:从模拟上传 simulation.log 到 S3 存储桶

Gatling: upload simulation.log to S3 bucket from simulation

我想在模拟完成后将场景的 simulation.log 文件上传到 S3 存储桶。

我正在考虑在我的模拟的 after 块中添加上传。

我没有找到任何这样的例子。我只发现模拟外部的脚本会处理它。

我有什么理由不应该这样做吗?

如果没有,我怎样才能得到simulation.log的绝对路径?

不幸地阻止了 'after' 提前执行然后生成报告。 我建议编写一个在测试后运行的脚本。

  1. 转到包含上一份报告的目录。
cd target/gatling && cd "$(ls -td -- */ | head -n 1 | cut -d'/' -f1)"
  1. 使用 aws cli 上传到 s3
aws s3 cp simulation.log s3://my-bucket/