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

Ensure first window is always small #106

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

istreeter
Copy link
Contributor

This change affects windowing apps e.g. Lake Loader.

Before this change, the first window was a random size, to avoid write conflicts between several loaders finishing their windows at similar times. After this change, the first window is still random, but sized in the ranged 25% to 50% of the regular window size. This was shown in Lake Loader to give a smoother starting cpu profile, and it prevents the loader from pulling in too many events into the first window.

This change affects windowing apps e.g. Lake Loader.

Before this change, the first window was a random size, to avoid write
conflicts between several loaders finishing their windows at similar
times. After this change, the first window is still random, but sized in
the ranged 25% to 50% of the regular window size. This was shown in Lake
Loader to give a smoother starting cpu profile, and it prevents the
loader from pulling in too many events into the first window.
@@ -62,7 +67,7 @@ object EventProcessingConfig {
for {
random <- Random.scalaUtilRandom
factor <- random.nextDouble
} yield TimedWindows(duration, factor, numEagerWindows)
} yield TimedWindows(duration, 0.25 * (1.0 + factor), numEagerWindows)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is betweenDouble in Random. Would that work here and maybe make the range a bit more clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well spotted. Nice idea.

@istreeter istreeter merged commit 385ae5a into develop Jan 13, 2025
1 check passed
@istreeter istreeter deleted the smaller-first-window branch January 13, 2025 13:09
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