-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Xueliang Yang <[email protected]>
- Loading branch information
Showing
4 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
vegeta: { | ||
annotations: {} | ||
attributes: { | ||
appliesToWorkloads: ["webservice","worker","cloneset"] | ||
conflictsWith: [] | ||
podDisruptive: false | ||
workloadRefPath: "" | ||
} | ||
description: "" | ||
labels: {} | ||
type: "trait" | ||
} | ||
|
||
template: { | ||
outputs:"vegeta":{ | ||
metadata: { | ||
name: context.name | ||
namespace: context.namespace | ||
} | ||
spec: { | ||
backoffLimit: parameter.backofflimit | ||
completions: parameter.parallelism | ||
parallelism: parameter.parallelism | ||
template: { | ||
metadata: name: context.name | ||
spec: { | ||
containers: [{ | ||
name: context.name | ||
args: ["echo '" + parameter.dorequest + "'"+ "|"+parameter.vegetacli] | ||
command: ["/bin/sh", "-c"] | ||
image: parameter.image | ||
}] | ||
restartPolicy: parameter.restartPolicy | ||
} | ||
} | ||
} | ||
apiVersion: "batch/v1" | ||
kind: "Job" | ||
} | ||
parameter: { | ||
backofflimit: *0|int | ||
parallelism: *1|int | ||
image:*"quay.io/karansingh/vegeta-ubi"|string | ||
restartPolicy: *"OnFailure"|string | ||
dorequest: string | ||
vegetacli: *"vegeta attack -rate 5000 -duration 10000m | vegeta encode"|string | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: vegeta | ||
version: 12.8.4 | ||
description: Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a command line utility and a library. | ||
url: https://github.com/tsenart/vegeta | ||
icon: https://camo.githubusercontent.com/faf9be097f4731212debdd24210c750b2dc276d0a17df19c6a8ac026427c09e9/687474703a2f2f666330392e64657669616e746172742e6e65742f667334392f692f323030392f3139382f632f632f73736a325f7665676574615f62795f7472756e6b7332342e6a7067 | ||
|
||
tags: | ||
- extended_trait | ||
|
||
deployTo: | ||
control_plane: true | ||
|
||
invisible: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
# Supported workload type | ||
Vegeta Trait supports following component types: webservice、worker and cloneset. | ||
|
||
# How to start | ||
- Use a component typed webservice to start, keep the following to show-vegeta.yaml, then vela up -f show-vegeta.yaml | ||
```shell | ||
apiVersion: core.oam.dev/v1beta1 | ||
kind: Application | ||
metadata: | ||
name: new-vegeta | ||
namespace: vegeta | ||
spec: | ||
components: | ||
- name: new-vegeta | ||
type: webservice | ||
properties: | ||
exposeType: ClusterIP | ||
image: nginx:latest | ||
ports: | ||
- expose: true | ||
port: 80 | ||
protocol: TCP | ||
ports: 80 | ||
traits: | ||
- type: vegeta | ||
properties: | ||
dorequest: 'GET http://show-vegeta:80' | ||
parallelism: 1 | ||
backofflimit: 10 | ||
``` | ||
|
||
- Check the app status and trait status | ||
```shell | ||
vela ls app -n vegeta | ||
APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME | ||
new-vegeta new-vegeta webservice vegeta running healthy Ready:1/1 2022-05-31 21:24:28 +0800 CST | ||
|
||
vela status new-vegeta -n vegeta | ||
About: | ||
|
||
Name: new-vegeta | ||
Namespace: vegeta | ||
Created at: 2022-05-31 21:24:28 +0800 CST | ||
Status: running | ||
|
||
Workflow: | ||
|
||
mode: DAG | ||
finished: true | ||
Suspend: false | ||
Terminated: false | ||
Steps | ||
- id:rqfzusuxgj | ||
name:new-vegeta | ||
type:apply-component | ||
phase:succeeded | ||
message: | ||
|
||
Services: | ||
|
||
- Name: new-vegeta | ||
Cluster: local Namespace: vegeta | ||
Type: webservice | ||
Healthy Ready:1/1 | ||
Traits: | ||
? vegeta | ||
|
||
vela 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-vegeta | ||
Cluster: local | Namespace: vegeta | Kind: Job | Name: new-vegeta | ||
|
||
Choose the Job to show testing data logs | ||
``` | ||
|
||
- If you want a more nice demo, use the two tools: jaggr and jplot to show the data | ||
```shell | ||
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 | ||
``` | ||
|
||
- How to install jplot and jagrr | ||
- https://github.com/rs/jplot | ||
- https://github.com/rs/jaggr |