版本:v1.6

vegeta

  1. $ vela addon enable vegeta
  1. $ vela addon disable vegeta

Vegeta Trait 支持下面的几种工作负载webservice,worker 和 cloneset。

使用一个 webservice 组件来开始,将下面的声明保存到 show-vegeta.yaml,并运行 vela up -f show-vegeta.yaml 来启动。

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: new-vegeta
  5. namespace: vegeta
  6. spec:
  7. components:
  8. - name: new-vegeta
  9. type: webservice
  10. properties:
  11. exposeType: ClusterIP
  12. image: nginx:latest
  13. ports:
  14. - expose: true
  15. port: 80
  16. protocol: TCP
  17. ports: 80
  18. traits:
  19. - type: vegeta
  20. properties:
  21. dorequest: 'GET http://show-vegeta:80'
  22. parallelism: 1
  23. backofflimit: 10

检查 app 和 trait 的状态:

  1. vela ls app -n vegeta
  2. APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME
  3. new-vegeta new-vegeta webservice vegeta running healthy Ready:1/1 2022-05-31 21:24:28 +0800 CST
  4. vela status new-vegeta -n vegeta
  5. About:
  6. Name: new-vegeta
  7. Namespace: vegeta
  8. Created at: 2022-05-31 21:24:28 +0800 CST
  9. Status: running
  10. Workflow:
  11. mode: DAG
  12. finished: true
  13. Suspend: false
  14. Terminated: false
  15. Steps
  16. - id:rqfzusuxgj
  17. name:new-vegeta
  18. type:apply-component
  19. phase:succeeded
  20. message:
  21. Services:
  22. - Name: new-vegeta
  23. Cluster: local Namespace: vegeta
  24. Type: webservice
  25. Healthy Ready:1/1
  26. Traits:
  27. ? vegeta
  28. vela logs new-vegeta --name new-vegeta -n vegeta
  29. ? You have 2 deployed resources in your app. Please choose one: [Use arrows to move, type to filter]
  30. > Cluster: local | Namespace: vegeta | Kind: Deployment | Name: new-vegeta
  31. Cluster: local | Namespace: vegeta | Kind: Job | Name: new-vegeta
  32. Choose the Job to show testing data logs
  • 如果你想获取一个更友好的输出,使用下面这两个工具: jaggr 和 jplot 来查看数据。
  1. kubectl logs new-vegeta--1-qrh67 -n vegeta -f | jaggr @count=rps hist\[100,200,300,400,500\]:code p25,p50,p95:latency sum:bytes_in sum:bytes_out | jplot rps+code.hist.100+code.hist.200+code.hist.300+code.hist.400+code.hist.500 latency.p95+latency.p50+latency.p25 bytes_in.sum+bytes_out.sum

Last updated on 2022年12月1日 by Somefive