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

Chore: Make NewViewDuration accept Duration-based timeouts #166

Open
meling opened this issue Jan 16, 2025 · 0 comments
Open

Chore: Make NewViewDuration accept Duration-based timeouts #166

meling opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
cleanup Improve readability, design patterns, and simplification

Comments

@meling
Copy link
Member

meling commented Jan 16, 2025

The NewViewDuration expects float64 for two of its timeout inputs:

viewDuration = synchronizer.NewViewDuration(
	uint64(opts.GetTimeoutSamples()),
	float64(opts.GetInitialTimeout().AsDuration().Nanoseconds())/float64(time.Millisecond),
	float64(opts.GetMaxTimeout().AsDuration().Nanoseconds())/float64(time.Millisecond),
	float64(opts.GetTimeoutMultiplier()),
)

We should write a test for the ViewDuration implementation and change the signature from this:

func NewViewDuration(sampleSize uint64, startTimeout, maxTimeout, multiplier float64) ViewDuration {

To this:

func NewViewDuration(sampleSize uint64, multiplier float64, startTimeout, maxTimeout time.Duration) ViewDuration {
@meling meling added the cleanup Improve readability, design patterns, and simplification label Jan 16, 2025
@AlanRostem AlanRostem self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Improve readability, design patterns, and simplification
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants