-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path15.performance-monitoring.yml
101 lines (91 loc) · 2.56 KB
/
15.performance-monitoring.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
apiVersion: frisbee.dev/v1alpha1
kind: Template
metadata:
name: iperf.server
spec:
service:
decorators: # Add support for Telemetry22
telemetry: [ frisbee.system.telemetry.resources ]
containers:
- name: main
image: czero/iperf2
ports:
- name: listen
containerPort: 5001
resources:
limits:
cpu: "0.2"
memory: "500Mi"
command:
- /bin/sh # Run shell
- -c # Read from string
- | # Multi-line str
set -eum
cut -d ' ' -f 4 /proc/self/stat > /dev/shm/app # Sidecar: use it for entering the cgroup
iperf -s -f m -i 5
---
apiVersion: frisbee.dev/v1alpha1
kind: Template
metadata:
name: iperf.client
spec:
inputs:
parameters:
target: localhost
service:
decorators:
telemetry: # Register Telemetry Agents
- frisbee.system.telemetry.resources # Collect Generic System's Metrics
- frisbee.apps.iperf2.client.telemetry # Collect App Specific Metrics
containers:
- name: main
image: czero/iperf2
command:
- /bin/sh # Run shell
- -c # Read from string
- | # Multi-line str
set -eum
cut -d ' ' -f 4 /proc/self/stat > /dev/shm/app # Sidecar: use it for entering the cgroup
iperf -c {{.inputs.parameters.target}} -t 1000 > /dev/shm/pipe
---
apiVersion: frisbee.dev/v1alpha1
kind: Scenario
metadata:
name: performance-monitoring
spec:
actions:
- action: Service
name: server
service:
templateRef: iperf.server
# Create a first cluster
- action: Cluster
name: group-a
depends: { running: [ server ] }
cluster:
templateRef: iperf.client
instances: 3
inputs:
- { target: server }
# Create a second cluster
- action: Cluster
name: group-b
depends: { running: [ server ] }
cluster:
templateRef: iperf.client
instances: 3
inputs:
- { target: server }
# Delete the second cluster.
- action: Delete
name: delete-group-b
depends: { running: [ group-b ], after: "120s" }
delete: # referenced jobs should be actions.
jobs: [ group-b ]
# When all actions are done, delete looping servers to gracefully exit the experiment
- action: Delete
name: teardown
depends: { running: [ server ], success: [ delete-group-b, group-a ] }
delete:
jobs: [ server ]