Skip to content

Commit 93d1797

Browse files
committed
[loadgen] add support for passing feature flags
1 parent c646de9 commit 93d1797

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

dev/loadgen/cmd/benchmark.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var benchmarkCommand = &cobra.Command{
7474
7575
Username: "foobar",
7676
},
77-
FeatureFlags: []api.WorkspaceFeatureFlag{},
77+
FeatureFlags: scenario.FeatureFlags,
7878
Timeout: "5m",
7979
WorkspaceImage: "will-be-overriden",
8080
WorkspaceLocation: "workspace-stress",
@@ -197,6 +197,7 @@ type BenchmarkScenario struct {
197197
StoppingTimeout string `json:"waitForStopping"`
198198
SuccessRate float32 `json:"successRate"`
199199
WorkspaceClass string `json:"workspaceClass"`
200+
FeatureFlags []api.WorkspaceFeatureFlag `json:"featureFlags"`
200201
}
201202

202203
func handleWorkspaceDeletion(timeout string, executor loadgen.Executor, canceled bool) error {
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
## start with
2+
## loadgen benchmark prod-benchmark.yaml
3+
4+
workspaces: 1
5+
ideImage: eu.gcr.io/gitpod-core-dev/build/ide/code:commit-ff263e14024f00d0ed78386b4417dfa6bcd4ae2f
6+
waitForRunning: "600s"
7+
waitForStopping: "600s"
8+
successRate: 1
9+
environment:
10+
- name: "THEIA_SUPERVISOR_TOKENS"
11+
value: '[{"token":"foobar","host":"gitpod-staging.com","scope":["function:getWorkspace","function:getLoggedInUser","function:getPortAuthenticationToken","function:getWorkspaceOwner","function:getWorkspaceUsers","function:isWorkspaceOwner","function:controlAdmission","function:setWorkspaceTimeout","function:getWorkspaceTimeout","function:sendHeartBeat","function:getOpenPorts","function:openPort","function:closePort","function:getLayout","function:generateNewGitpodToken","function:takeSnapshot","function:storeLayout","function:stopWorkspace","resource:workspace::fa498dcc-0a84-448f-9666-79f297ad821a::get/update","resource:workspaceInstance::e0a17083-6a78-441a-9b97-ef90d6aff463::get/update/delete","resource:snapshot::*::create/get","resource:gitpodToken::*::create","resource:userStorage::*::create/get/update"],"expiryDate":"2020-12-01T07:55:12.501Z","reuse":2}]'
12+
workspaceClass: "g1-standard-pvc"
13+
featureFlags:
14+
- 7
15+
repos:
16+
- cloneURL: https://github.com/Furisto/workspace-stress
17+
cloneTarget: main
18+
score: 20
19+
workspaceImage: eu.gcr.io/gitpod-dev/dev/loadtest/workspace-stress:latest
20+
environment:
21+
# cpu
22+
- name: "CPU_COUNT" # start N workers
23+
value: "3"
24+
- name: "CPU_BACKOFF" # wait N microseconds between the start of each stress worker process
25+
value: "10000000"
26+
- name: "CPU_TIMEOUT" # stop cpu stress test after N seconds
27+
value: "600s"
28+
# common IO
29+
- name: "DISK_IO_FILE_SIZE" # how big of a test-file should be used
30+
value: "2g"
31+
- name: "DISK_IO_TOTAL" # specifies how much I/O will be done
32+
value: "100g"
33+
- name: "DISK_IO_TIMEOUT" # stop io stress test after N seconds
34+
value: "600"
35+
# random read/write IO
36+
# - name: DISK_IO_MODE # values can be read, write, rw, randreadm randwrite, randrw
37+
# value: "randrw"
38+
# - name: "DISK_IO_BLOCKSIZE" # specifies the block-size that will be used
39+
# value: "8k"
40+
# - name: "DISK_IO_FSYNC" # sync command which writes kernel cached pages to disk every number of blocks specified
41+
# value: 1000
42+
# - name: "DISK_IO_DEPTH" # specifies number of I/O units to keep in-flight
43+
# value: 10
44+
# - name: "DISK_IO_JOBS" # specifies the number of jobs
45+
# value: 20
46+
# sequential read/write IO
47+
- name: DISK_IO_MODE # values can be read, write, rw, randreadm randwrite, randrw
48+
value: "rw"
49+
- name: "DISK_IO_BLOCKSIZE" # specifies the block-size that will be used
50+
value: "1024k"
51+
- name: "DISK_IO_FSYNC" # sync command which writes kernel cached pages to disk every number of blocks specified
52+
value: 10000
53+
- name: "DISK_IO_DEPTH" # specifies number of I/O units to keep in-flight
54+
value: 32
55+
- name: "DISK_IO_JOBS" # specifies the number of jobs
56+
value: 1
57+
# memory
58+
- name: "MEMORY_BYTES" # systems if not enough physical memory and swap is not available
59+
value: "6G"
60+
- name: "MEMORY_TIMEOUT" # stop cpu stress test after N seconds
61+
value: "600s"
62+
# backup
63+
- name: "BACKUP_SIZE" # size of the backup in gigabyte
64+
value: 12
65+
# tasks
66+
- name: "GITPOD_TASKS"
67+
value: "[{\"name\":\"start cpu stress\",\"command\":\"stress-ng --cpu ${CPU_COUNT:-3} --backoff ${CPU_BACKOFF:-10000000} --timeout ${CPU_TIMEOUT:-600s}\"},{\"name\":\"start io stress\",\"command\":\"fio --name io-stress --eta-newline=5s --filename=/workspace/gitpod.temp --rw=${DISK_IO_MODE} --size=${DISK_IO_FILE_SIZE:-2g} --io_size=${DISK_IO_TOTAL:-50g} --blocksize=${DISK_IO_BLOCKSIZE} --ioengine=libaio --fsync=${DISK_IO_FSYNC} --iodepth=${DISK_IO_DEPTH} --direct=1 --numjobs=${DISK_IO_JOBS} --runtime=${DISK_IO_TIMEOUT:-600}\"},{\"name\":\"start memory stress\",\"command\":\"stress-ng --vm 1 --vm-keep --vm-bytes ${MEMORY_BYTES:-6G} --timeout ${MEMORY_TIMEOUT:-600s}\"},{\"name\":\"create backup file\",\"command\":\"dd if=/dev/zero of=/workspace/benchmark-backup bs=1000M count=${BACKUP_SIZE:-2}\"}]"
68+
- cloneURL: https://github.com/gitpod-io/template-typescript-node
69+
cloneTarget: master
70+
score: 20
71+
workspaceImage: eu.gcr.io/gitpod-dev/workspace-images:dd3075638ccf424374cc9c681b3d2338908d07115b28e54856cd45604c33768c
72+
- cloneURL: https://github.com/gitpod-io/template-typescript-react
73+
cloneTarget: main
74+
score: 20
75+
workspaceImage: eu.gcr.io/gitpod-dev/workspace-images:e764b1a602dc4123d9a027358367b5c4a35b62043e3c630731702144b7d37f77
76+
- cloneURL: https://github.com/gitpod-io/template-python-django
77+
cloneTarget: main
78+
score: 20
79+
workspaceImage: eu.gcr.io/gitpod-dev/workspace-images:e764b1a602dc4123d9a027358367b5c4a35b62043e3c630731702144b7d37f77
80+
- cloneURL: https://github.com/gitpod-io/template-python-flask
81+
score: 20
82+
cloneTarget: main
83+
workspaceImage: eu.gcr.io/gitpod-dev/workspace-images:32b2dc5f2707904a9338a97c77a039706df661b5c5e4a5851f1ee74f06a38fd3

0 commit comments

Comments
 (0)