-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
158 lines (131 loc) · 5.2 KB
/
Copy pathMakefile
File metadata and controls
158 lines (131 loc) · 5.2 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
DURATION ?= 600
REQUESTS ?= 500000
CONCURRENCY ?= 300
CPU_LOAD ?= 90
LOW_CPU_LOAD ?= 5
CPU_WORKERS ?= 0
CPU_CYCLE_COUNT ?= 6
CPU_CYCLE_HIGH ?= 120
CPU_CYCLE_LOW ?= 90
REQUEST_CYCLE_COUNT ?= 5
REQUEST_CYCLE_HIGH ?= 180
REQUEST_CYCLE_LOW ?= 120
REQUEST_LOW_CONCURRENCY ?= 5
REQUEST_LOW_COUNT ?= 1000
LAB01_CYCLE_COUNT ?= 2
LAB01_CYCLE_HIGH ?= 120
LAB01_CYCLE_LOW ?= 120
LAB01_CPU_LOAD ?= 90
# These values are used in Labs 2, 3, and 4 to generate CPU and request load
LAB02_CPU_CYCLE_COUNT ?= 1
LAB02_CPU_CYCLE_HIGH ?= 180
LAB02_CPU_CYCLE_LOW ?= 0
LAB02_CPU_LOAD ?= 90
LAB02_REQUEST_RATE ?= 10
LAB02_REQUEST_RATE_MULTIPLIERS ?= 1 2 3 3
LAB02_REQUEST_CYCLE_COUNT ?= 4
LAB02_REQUEST_HIGH ?= 180
LAB02_REQUEST_LOW ?= 0
LAB03_SUSTAINED_ERROR_RATE ?= 1
.DEFAULT_GOAL := help
help: ## Display available tooling and lab targets
@awk 'BEGIN {FS = ":.*## "}; /^[a-zA-Z0-9_-]+:.*## / {printf "\033[36m%-28s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
preflight: _executable ## Verify tagged lab resources and required software
./load-generator.sh --preflight
stop-load: _executable ## Stop active CPU and request stimulus
./load-generator.sh --stop-load
reset-asg: _executable ## Stop stimulus and reset the tagged ASG to minimum capacity
./load-generator.sh --reset-asg
cpu-spike: _executable ## Create one CPU spike
./load-generator.sh --cpu \
--cycles 1 \
--high-duration "$(DURATION)" \
--low-duration 60 \
--cpu-load "$(CPU_LOAD)" \
--low-cpu-load "$(LOW_CPU_LOAD)" \
--cpu-workers "$(CPU_WORKERS)"
cpu-cycle: _executable ## Create repeated CPU high/low cycles
./load-generator.sh --cpu \
--cycles "$(CPU_CYCLE_COUNT)" \
--high-duration "$(CPU_CYCLE_HIGH)" \
--low-duration "$(CPU_CYCLE_LOW)" \
--cpu-load "$(CPU_LOAD)" \
--low-cpu-load "$(LOW_CPU_LOAD)" \
--cpu-workers "$(CPU_WORKERS)"
request-spike: _executable ## Create one HTTP request spike
./load-generator.sh --requests "$(REQUESTS)" \
--cycles 1 \
--high-duration "$(DURATION)" \
--low-duration 60 \
--high-concurrency "$(CONCURRENCY)"
request-cycle: _executable ## Create repeated HTTP request high/low cycles
./load-generator.sh --requests "$(REQUESTS)" \
--cycles "$(REQUEST_CYCLE_COUNT)" \
--high-duration "$(REQUEST_CYCLE_HIGH)" \
--low-duration "$(REQUEST_CYCLE_LOW)" \
--high-concurrency "$(CONCURRENCY)" \
--low-concurrency "$(REQUEST_LOW_CONCURRENCY)" \
--low-request-count "$(REQUEST_LOW_COUNT)" \
--wait-for-low-phase
mixed-spike: _executable ## Create one combined CPU and HTTP spike
./load-generator.sh --cpu --requests "$(REQUESTS)" \
--cycles 1 \
--high-duration "$(DURATION)" \
--low-duration 60 \
--cpu-load "$(CPU_LOAD)" \
--low-cpu-load "$(LOW_CPU_LOAD)" \
--cpu-workers "$(CPU_WORKERS)" \
--high-concurrency "$(CONCURRENCY)"
mixed-cycle: _executable ## Create repeated combined CPU and HTTP cycles
./load-generator.sh --cpu --requests "$(REQUESTS)" \
--cycles "$(REQUEST_CYCLE_COUNT)" \
--high-duration "$(REQUEST_CYCLE_HIGH)" \
--low-duration "$(REQUEST_CYCLE_LOW)" \
--cpu-load "$(CPU_LOAD)" \
--low-cpu-load "$(LOW_CPU_LOAD)" \
--cpu-workers "$(CPU_WORKERS)" \
--high-concurrency "$(CONCURRENCY)" \
--low-concurrency "$(REQUEST_LOW_CONCURRENCY)" \
--low-request-count "$(REQUEST_LOW_COUNT)" \
--wait-for-low-phase
lab-01: preflight ## Run the Lab 1 stimulus
./load-generator.sh --cpu \
--cycles "$(LAB01_CYCLE_COUNT)" \
--high-duration "$(LAB01_CYCLE_HIGH)" \
--low-duration "$(LAB01_CYCLE_LOW)" \
--cpu-load "$(LAB01_CPU_LOAD)" \
--low-cpu-load 0 \
--cpu-workers "$(CPU_WORKERS)"
lab-02-cpu: preflight ## Run the Lab 2 CPU-only stimulus
./load-generator.sh --cpu \
--cycles "$(LAB02_CPU_CYCLE_COUNT)" \
--high-duration "$(LAB02_CPU_CYCLE_HIGH)" \
--low-duration "$(LAB02_CPU_CYCLE_LOW)" \
--cpu-load "$(LAB02_CPU_LOAD)" \
--low-cpu-load "$(LOW_CPU_LOAD)" \
--cpu-workers "$(CPU_WORKERS)"
lab-02-requests: preflight ## Run the Lab 2 customer-request stimulus
./load-generator.sh --requests \
--request-rate "$(LAB02_REQUEST_RATE)" \
--request-rate-multipliers "$(LAB02_REQUEST_RATE_MULTIPLIERS)" \
--cycles "$(LAB02_REQUEST_CYCLE_COUNT)" \
--high-duration "$(LAB02_REQUEST_HIGH)" \
--low-duration "$(LAB02_REQUEST_LOW)"
lab-03-cpu: lab-02-cpu ## Run Lab 3 CPU-only stimulus
lab-03-requests: lab-02-requests ## Run the Lab 3 customer-request stimulus
lab-03-sustained-errors: preflight ## Generate sustained target errors below the scaling threshold
./load-generator.sh --requests \
--request-path /error \
--request-rate "$(LAB03_SUSTAINED_ERROR_RATE)" \
--cycles 1 \
--high-duration "$(LAB02_REQUEST_HIGH)" \
--low-duration "$(LAB02_REQUEST_LOW)"
lab-04-cpu: lab-02-cpu ## Run Lab 4 CPU-only stimulus
lab-04-requests: lab-02-requests ## Run the Lab 4 customer-request stimulus
lab-04-sustained-errors: lab-03-sustained-errors ## Run Lab 4 sustained target errors below the scaling threshold
_executable:
@chmod +x load-generator.sh
.PHONY: help preflight stop-load reset-asg cpu-spike cpu-cycle request-spike request-cycle
.PHONY: mixed-spike mixed-cycle lab-01 lab-02-cpu lab-02-requests
.PHONY: lab-03-requests lab-03-cpu lab-03-sustained-errors executable
.PHONY: lab-04-requests lab-04-cpu lab-04-sustained-errors