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

Reuse SecretManagerServiceClient instance in DefaultGcpSecretSupplier #440

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

ajyoon
Copy link
Contributor

@ajyoon ajyoon commented Feb 12, 2025

Summary

During startup profiling I found we spend 600ms (on my computer) repeatedly creating this secrets manager client for each use. We should be able to hold a common instance in the supplier class.

Checklist

  • Documentation (root README, Feature READMEs, KDoc, comments).
  • Logging.
  • Tests.

During startup profiling I found we spend 600ms (on my computer)
repeatedly creating this secrets manager client for each use.
We should be able to hold a common instance in the supplier class.
@ajyoon ajyoon requested a review from hudson155 as a code owner February 12, 2025 17:48
@@ -9,13 +9,17 @@ import kairo.protectedString.ProtectedString

private val logger: KLogger = KotlinLogging.logger {}

public object DefaultGcpSecretSupplier : GcpSecretSupplier() {
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we want/need to switch this from an object to a class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just shy away from stateful objects, but if you prefer I can change it

Copy link
Owner

Choose a reason for hiding this comment

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

Got it, sounds good!

@@ -9,13 +9,17 @@ import kairo.protectedString.ProtectedString

private val logger: KLogger = KotlinLogging.logger {}

public object DefaultGcpSecretSupplier : GcpSecretSupplier() {
Copy link
Owner

Choose a reason for hiding this comment

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

Got it, sounds good!

@hudson155 hudson155 merged commit a32f393 into hudson155:main Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants