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

feat: flush queue before next event polling #18

Merged
merged 6 commits into from
Oct 12, 2022
Merged

Conversation

korniltsev
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@eh-am eh-am left a comment

Choose a reason for hiding this comment

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

Looks good, couple thoughts:

  1. Let's document that parameter in the README.md.
  2. I think would be better to make it clearer in the env var name WHEN it flushes: something like PYROSCOPE_FLUSH_ON_INVOKE. Not too sold on this if we document it on the readme tbh.

main.go Outdated
@@ -37,6 +37,8 @@ var (

// profile the extension?
selfProfiling = getEnvBool("PYROSCOPE_SELF_PROFILING")

flushRelayQueue = getEnvBool("PYROSCOPE_FLUSH_RELAY_QUEUE")
Copy link
Collaborator

@eh-am eh-am Oct 5, 2022

Choose a reason for hiding this comment

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

This is false by default, my understanding is that this functionality has no clear downsides right? Shouldn't we make it true by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The downside is that it can increase lambda invocation time and as a result billing. I'd keep it disabled by default. But it is not super strong opinion, we can change to enabled by default.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh I see now, since flush is sync, it makes the time before waiting for new events longer, therefore making it more expensive.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe good idea to rename Flush to FlushSync so it is more obvious

README.md Outdated Show resolved Hide resolved
Co-authored-by: eduardo aleixo <eh-am@users.noreply.github.com>
@korniltsev korniltsev merged commit e5b06d2 into main Oct 12, 2022
@korniltsev korniltsev deleted the feat/queue_flush branch October 12, 2022 15:13
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.

None yet

2 participants