我正在集群中運行一些壓力測驗。我在 jar 中編譯 Gatling 代碼并在 dockerized 環境中運行它。同樣,我想知道是否有辦法將最終的 Gatling 報告上傳到 S3。afterGatling 模擬類中有鉤子,但我認為這是在生成報告之前執行的。
uj5u.com熱心網友回復:
我認為在不更改加特林代碼或 jar 的情況下執行此操作的一種簡單方法是:
- 使運行測驗的 docker 容器作為 init 容器運行
- init 容器運行后,主容器啟動并可以使用 bash 命令或其他任何方式(例如,使用 tinys3 - https://github.com/smore-inc/tinys3)執行 s3 上傳
只是一個一般的例子:
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
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/331129.html
標籤:斯卡拉 亚马逊-s3 Kubernetes 亚马逊-eks 加特林
