简体   繁体   English

将加特林报告上传到 s3

[英]Uploading gatling report to s3

I'm running some stresses tests in cluster.我正在集群中运行一些压力测试。 I compile Gatling code in a jar and run it in a dockerized environment.我在 jar 中编译 Gatling 代码并在 dockerized 环境中运行它。 Likewise, I was wondering if there is a way to upload the final Gatling report to S3.同样,我想知道是否有办法将最终的 Gatling 报告上传到 S3。 There is after hook in Gatling simulation class, but I think this is getting executed before the report is generated. Gatling 模拟类中有after hook,但我认为这是在生成报告之前执行的。

An easy way I can think to do this without changing even the gatling code or the jar, is to simply:我认为在不更改加特林代码或 jar 的情况下执行此操作的一种简单方法是:

  • Make the docker container running the tests run as an init container使运行测试的 docker 容器作为 init 容器运行
  • After the init container had run, a main container starts and can do the s3 upload, either with bash commands or with whatever (example, with tinys3 - https://github.com/smore-inc/tinys3 ) init 容器运行后,主容器启动并可以使用 bash 命令或其他任何方式(例如,使用 tinys3 - https://github.com/smore-inc/tinys3 )执行 s3 上传

Just a general example:只是一个一般的例子:

apiVersion: v1
kind: Pod
metadata:
  labels:
    app.kubernetes.io/instance: gatling-stress-test
    app.kubernetes.io/name: gatling-stress-test
  name: gatling-stress-test
spec:
  initContainers:
  - name: gatling-stress-test-runner
    image: gatling-docker-image:latest
    imagePullPolicy: Always
    volumeMounts:
    - mountPath: /full/path/to/gatling/reports
      name: reports
  containers:
  - name: stress-test-s3-copier
    image: ubuntu-image-with-tinys3:latest
    imagePullPolicy: Always
    volumeMounts:
    - mountPath: /full/path/to/gatling/reports
      name: reports
  volumes:
  - emptyDir: {}
    name: reports

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM