vegeta
安装插件
$ vela addon enable vegeta
卸载插件
$ vela addon disable vegeta
支持的工作负载类型
Vegeta Trait 支持下面的几种工作负载webservice,worker 和 cloneset。
开始使用
使用一个 webservice 组件来开始,将下面的声明保存到 show-vegeta.yaml,并运行 vela up -f show-vegeta.yaml 来启动。
apiVersion: core.oam.dev/v1beta1kind: Applicationmetadata:name: new-vegetanamespace: vegetaspec:components:- name: new-vegetatype: webserviceproperties:exposeType: ClusterIPimage: nginx:latestports:- expose: trueport: 80protocol: TCPports: 80traits:- type: vegetaproperties:dorequest: 'GET http://show-vegeta:80'parallelism: 1backofflimit: 10
检查 app 和 trait 的状态:
vela ls app -n vegetaAPP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIMEnew-vegeta new-vegeta webservice vegeta running healthy Ready:1/1 2022-05-31 21:24:28 +0800 CSTvela status new-vegeta -n vegetaAbout:Name: new-vegetaNamespace: vegetaCreated at: 2022-05-31 21:24:28 +0800 CSTStatus: runningWorkflow:mode: DAGfinished: trueSuspend: falseTerminated: falseSteps- id:rqfzusuxgjname:new-vegetatype:apply-componentphase:succeededmessage:Services:- Name: new-vegetaCluster: local Namespace: vegetaType: webserviceHealthy Ready:1/1Traits:? vegetavela logs new-vegeta --name new-vegeta -n vegeta? You have 2 deployed resources in your app. Please choose one: [Use arrows to move, type to filter]> Cluster: local | Namespace: vegeta | Kind: Deployment | Name: new-vegetaCluster: local | Namespace: vegeta | Kind: Job | Name: new-vegetaChoose the Job to show testing data logs
- 如果你想获取一个更友好的输出,使用下面这两个工具: jaggr 和 jplot 来查看数据。
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
- 如何安装 jplot 和 jagrr