Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(kubernetes): A few minor refactors and perf fixes #3813

Merged
merged 4 commits into from
Jun 24, 2019
Merged

refactor(kubernetes): A few minor refactors and perf fixes #3813

merged 4 commits into from
Jun 24, 2019

Conversation

ezimanyi
Copy link
Contributor

These are all small changes I had on local branches while I was doing performance profiling. The refactor commits have no performance effect, but I made them while trying to split up the code into smaller pieces that I could understand better so I think they're worth commiting for that reason.

  • perf(kubernetes): Reduce deserialization of kubernetes pods

    We're currently deserializing the entire kubernetes pod object when we actually only need the status. Given that pods are very common objects, it's worth only deserializing the status to speed up the server groups endpoint.

  • refactor(kubernetes): Remove unused variable isNamespaced

  • refactor(kubernetes): Pull some logic from translateClusters

    The translateCluster function gets both server groups and load balancers; it would be more clear to have separate functions to do each of these.

  • refactor(kubernetes): Remove translateCluster function

    Now that translateCluster has been split into two smaller functions, remove it and call the two smaller ones.

We're currently deserializing the entire kubernetes pod object
when we actually only need the status. Given that pods are very
common objects, it's worth only deserializing the status to
speed up the server groups endpoint.
The translateCluster function gets both server groups and load
balancers; it would be more clear to have separate functions to
do each of these.
Now that translateCluster has been split into two smaller functions,
remove it and call the two smaller ones.
Copy link
Contributor

@maggieneterval maggieneterval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 💅

@ezimanyi ezimanyi merged commit 627d729 into spinnaker:master Jun 24, 2019
@ezimanyi ezimanyi deleted the misc-fixes branch June 24, 2019 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants