Commit Graph

76 Commits

Author SHA1 Message Date
Michael Spencer 74bc8c9412
[k6] Added resource creation scripts for vai testing (#86)
* initial commit, updates for independent count values

* support for downstreams, aligned function params with other tests

* updated login, cleanup

* updated thresholds

* Updated deployments to busybox
2025-10-07 10:56:31 -07:00
Iramis Valentin b50dae1b13
[k6] Add new VAI-focused resource churn script (#100)
* wip resource churn

* updates to  scenario

* add default 'system' filters, format api_benchmark

* optional filters, remove cruft, fix list urls

* added separate VU params

* re-add old change_configmaps.js, rename new configmap script

* add potential threshold updates, resolve various feedback points

* move script to vai dir

* fix per-scenario thresholds

* final threshold fix
2025-09-09 16:17:15 -04:00
Silvio Moioli 985ad080b3
feat(k6): Add Steve Watch API benchmark test (#102)
* first version from Gemini

Prompt used:

Take a look at the @k6 directory scripts, particularly @k6/tests/api_benchmark.js targeting Steve. I need a new k6 benchmark script along the same lines that tests the Watch functionality described in https://github.com/moio/apiserver/blob/watch_readme/README.md and https://github.com/moio/steve/blob/readme_watch/README.md. Specifically, I need to start watching the same resource (default: configmaps) in a configurable namespace (default: scalability-tests) from multiple Steve servers backed by the same Kubernetes API. A parallel scenario should change configmaps at a configurable rate, updating one configmaps at random via PUT to one of the configured Steve servers. There will be some delay between resource.changed events coming from the Steve servers, as they might not always have exactly the same speed. I need to measure and report the delta between the fastest and the slowest Steve (with stats: min, max, avg, p(95)), as well as the delay between a change in a configmap and the time the first Steve observes the change via Watch (with stats) and the time the last Steve observes it (with stats). mode should be the default for this test, but make it configurable to use resources.changes optionally.

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fix durations and iterations

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fix cookie passing in the websocket case - api is different there

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fixup! fix durations and iterations

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* Rework delay computation logic. VUs do not share data, not even global variables, piggyback on the ConfigMap instead

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* spray logging all over

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* Use WebSocket async API

Gemini prompt:

you used the standard k6 websocket api documented here https://grafana.com/docs/k6/latest/using-k6/protocols/websockets/. The problem is that it is blocking, so no more than one websocket is opened at any time. Re-read @k6/tests/steve_watch_benchmark.js considering all manual changes I've made as the good starting point. Migrate it over the new experimental API which is non-blocking, see https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fix timeout and error handling

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* add time after creation to not pollute watch measurements

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* improve logging

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* bugfix: ensure ints are ints

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* add settle time for watchers to start watching

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* hardcode watchers vus to 1. What we are interested in measuring is delay of replicas, not load here

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* make change vus parametric

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* add sainty thresholds

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* tear down before setup, in case an earlier run is half finished

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* rework logging so that verbose messages are only output with the verbose option

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* fix id to be truly unique and avoid misassignment of timestamps

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* hardcode resource type for now

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* add the ability to target both Steve and Kubernetes APIs

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* as an additional check, log the time the listener takes to run

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* add kube api watching

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* tune settle time

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* explainer for origin url

Signed-off-by: Silvio Moioli <silvio@moioli.net>

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2025-08-19 14:22:22 -04:00
Iramis Valentin 1d779acbe2
Fix scripts used by `dartboard load` command (#103)
* remove nonexistent roles/bindings

* remove nonexistent roles/bindings
2025-07-31 14:34:00 -04:00
Iramis Valentin a257320e86
Added custom rancher diagnostics metrics (#99)
* added rancher diagnostics metrics

* remove unused code

* fix time-based trend metrics
2025-07-18 15:09:34 -04:00
Iramis Valentin 669316955f
add load test for projects, namespaces, add various utils, rancher diagnostics (#84) 2025-07-15 12:25:43 -04:00
Iramis Valentin fe86eb53a9
update naming for data size tracking function, update retry function signatures (#85) 2025-07-15 12:25:31 -04:00
Silvio Moioli f31a60b111
fix types
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2025-07-10 18:39:39 +02:00
Silvio Moioli 38e5d5023e
add optional pauses between requests
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2025-07-10 16:53:51 +02:00
Iramis Valentin f2297ab4fa
update login() to return the response, other misc k6 updates (#82) 2025-07-01 18:23:40 -04:00
Michael Spencer 93baa40f19
Improved structure of k6 test suite (#57)
* initial commit

* updated filenames, moved rancher files

* updated paths, adjusted filenames

* updated filenames

* path fix

---------

Co-authored-by: Michael Spencer <MSpencer87@users.noreply.github.com>
2025-06-12 13:32:50 -07:00
Silvio Moioli c06f68e218
k6: add benchmark for listing resources directly from Kubernetes (#65)
* k6/k8s: make list limit configurable

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* k6: add Kubernetes api read benchmark

Signed-off-by: Silvio Moioli <silvio@moioli.net>

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2025-05-30 13:26:00 -04:00
Silvio Moioli 7a0b4186e6
k6/create_k8s_resources: script improvements (#64)
* create_k8s_resources: make namespace parametric

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* create_k8s_resources: make data size parametric

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* create_k8s_resources: make vus parametric

Signed-off-by: Silvio Moioli <silvio@moioli.net>

* create_k8s_resources: bugfix: actually add data to configmaps

Signed-off-by: Silvio Moioli <silvio@moioli.net>

---------

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2025-05-30 12:38:51 -04:00
Iramis Valentin c8c62cc430
remove inifinitely recursive Date() function (#55) 2025-05-01 12:39:43 -04:00
Iramis Valentin 8b4a04bedb
Update steve schema tests 2025-04-29 11:34:27 -04:00
Iramis Valentin eeacca101c
Merge pull request #50 from git-ival/complex-crd
Add complex tests for CRD changes from 2.9 Steve updates
2025-04-14 13:18:02 -04:00
Iramis Valentin 3a0640389d
remove unused randomarray func 2025-04-14 17:02:57 +00:00
Iramis Valentin 75ff0e9121
remove unnecessary util func 2025-04-14 16:05:10 +00:00
Iramis Valentin 889e2c89e5
update scenario names 2025-04-14 16:01:47 +00:00
Iramis Valentin 46eca3818a
add more complex CRD tests around update scenarios and general load 2025-03-26 18:49:45 +00:00
Iramis Valentin c59396d19a
add basic tests around CRDs 2025-03-26 18:45:06 +00:00
Iramis Valentin 6e4e1f8bda
add k6_with_env.sh for more easily running a given k6 script with a given .env 2025-02-21 21:11:46 +00:00
Iramis Valentin 991906603f
WIP lastused tokens test 2025-02-21 21:11:46 +00:00
Iramis Valentin d614599a49
refactor various utils, add new users-specific utils 2025-02-21 21:11:46 +00:00
Silvio Moioli e67c56ec01
k6: add a script to create resources with Steve
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-09-18 15:22:38 +02:00
Silvio Moioli 6789fe7360
k6/change_config_maps: fix the code so that the declared rate is actually respected
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-09-17 17:54:20 +02:00
Silvio Moioli eb1e1a0599
Merge pull request #9 from moio/k6_steve_scripts
k6: add steve scripts
2024-09-17 17:48:33 +02:00
Silvio Moioli d9c7adbec0
k6: add steve scripts
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-09-17 17:37:22 +02:00
Silvio Moioli b4b67b32c2
k6/api_benchmark: allow to benchmark only one page response
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-09-17 17:02:07 +02:00
Silvio Moioli aa4f0a9f9c
bugfix: make first login more robust (for 2.8.6 and 2.9.0)
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-08-28 17:05:47 +02:00
Silvio Moioli eca0f5b14f
bugfix: run first login init even in absence of downstream clusters
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-08-28 17:05:47 +02:00
Silvio Moioli bed6835976
api_benchmark: remove useless variable
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-05-09 13:05:26 +02:00
Silvio Moioli 67752568ed
k6: fix edge case
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-05-06 10:46:50 +02:00
Silvio Moioli 16e3d9ffb6
bump rancher version
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-04-22 13:01:44 +02:00
Silvio Moioli a9837dc7c5
Generalize api_benchmark.js to allow Norman API benchmarking as well
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-01-31 13:52:42 +01:00
Francesco Giudici bc9de9d05a k6:Roles&Users: make the resource load more gentle
The module started failing quite deterministically due to either getting
the 204 HTTP Status Code instead of the 200 (which is equally fine) and
also in the user / rolebindings creation part. Seems we have to wait a
bit to create the rolebinding after the user to be more successful.
Moreover... let's keep the virtual users to 1.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-01-09 17:08:22 +01:00
Francesco Giudici ff4e74e60a tests: fix creation of configmaps
Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2024-01-09 17:08:22 +01:00
Silvio Moioli 584b0f2d64
steve_paginated_api_benchmark: add parameter to add URL query fragments
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-11-21 12:32:58 +01:00
Silvio Moioli ecb88129dd
steve_paginated_api_benchmark.js: make page size configurable
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-10-27 14:07:08 +02:00
Silvio Moioli 226fae31c0
Allow for optional log in to test unauthenticated endpoints
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-10-27 14:07:08 +02:00
Silvio Moioli b58668a31e
Actually use Steve pagination
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-10-27 14:06:42 +02:00
Silvio Moioli d204e3c25f
Add criteria to detect 410 Gone status codes
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-10-27 14:06:42 +02:00
Silvio Moioli e85192435f
Add new API benchmark script
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-10-27 14:06:42 +02:00
Silvio Moioli 2f3f7017a7
create_roles_users: allow for more VUs when creating many objects
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-09-19 12:10:30 +02:00
Silvio Moioli b26cf518f5
Relax projectrolebindings failure checks (may legitimately take more)
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-09-19 12:10:30 +02:00
Silvio Moioli 491f3ebca3
Retry creating global role bindings on conflict
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-09-19 11:20:20 +02:00
Silvio Moioli 6d036bfdea
Tolerate projectroletemplatebindings failures
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-08-01 12:22:55 +02:00
Silvio Moioli db810b6a57
refactoring: rename
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-08-01 12:22:37 +02:00
Silvio Moioli cef51f043a
Add support to create Rancher projects
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-07-26 16:01:40 +02:00
Silvio Moioli f5b690f3c8
refactoring: move function
Signed-off-by: Silvio Moioli <silvio@moioli.net>
2023-07-26 13:16:40 +02:00