stackabletech / stackable-cockpit

Home of stackable-cockpit, stackablectl and stackable-cockpitd
https://docs.stackable.tech/management/stable/
Other
6 stars 2 forks source link

chore: Avoid unnecessary k8s::Client creations #295

Closed sbernauer closed 3 months ago

sbernauer commented 3 months ago

Description

Needs https://github.com/stackabletech/stackable-cockpit/pull/294 to properly work

Shows a significant speedup (e.g. when installing to IONOS) from 13s to 7.6s, the speedup is probably much higher on mobile networks (ask me after my next trip to Hamburg ^^)

➜  demos git:(observability-stack) ✗ time ~/stackable/stackable-cockpit/target/debug/stackablectl demo in end-to-end-security
   WARN  RUNNING DISCOVERY
    at rust/stackable-cockpit/src/utils/k8s/client.rs:80

Installed demo 'end-to-end-security'

Use "stackablectl operator installed" to display the installed operators.
Use "stackablectl stacklet list" to display the installed stacklets.
~/stackable/stackable-cockpit/target/debug/stackablectl demo in   2,72s user 0,55s system 43% cpu 7,430 total
➜  demos git:(observability-stack) ✗ time stackablectl demo in end-to-end-security          

Installed demo 'end-to-end-security'

Use "stackablectl operator installed" to display the installed operators.
Use "stackablectl stacklet list" to display the installed stacklets.
stackablectl demo in end-to-end-security  2,77s user 0,63s system 24% cpu 13,635 total
➜  demos git:(observability-stack) ✗ time ~/stackable/stackable-cockpit/target/debug/stackablectl demo in end-to-end-security
   WARN  RUNNING DISCOVERY
    at rust/stackable-cockpit/src/utils/k8s/client.rs:80

Installed demo 'end-to-end-security'

Use "stackablectl operator installed" to display the installed operators.
Use "stackablectl stacklet list" to display the installed stacklets.
~/stackable/stackable-cockpit/target/debug/stackablectl demo in   2,67s user 0,56s system 41% cpu 7,837 total
➜  demos git:(observability-stack) ✗ time stackablectl demo in end-to-end-security                                           

Installed demo 'end-to-end-security'

Use "stackablectl operator installed" to display the installed operators.
Use "stackablectl stacklet list" to display the installed stacklets.
stackablectl demo in end-to-end-security  2,73s user 0,61s system 27% cpu 12,115 total

Definition of Done Checklist

# Author
- [ ] Changes are OpenShift compatible
- [ ] CRD changes approved
- [ ] Helm chart can be installed and deployed operator works
- [ ] Integration tests passed (for non trivial changes)
# Reviewer
- [ ] Code contains useful comments
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated
- [ ] Changelog updated
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added