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

Added random latency to SQS receives. #198

Merged
merged 3 commits into from
Mar 1, 2020

Conversation

andykuszyk
Copy link
Contributor

Latency is based on the inclusion of two environment variables
(GOAWS_RANDOM_LATENCY_MIN and GOAWS_RANDOM_LATENCY_MAX), which, if set
will prevent messages from being released from the queue until after a
period of random, simulated latency has elapsed.

The purpose of this change is to aid in local testing against AWS when
SQS latency is expected and needs to be developed against.

Latency is based on the inclusion of two environment variables
(GOAWS_RANDOM_LATENCY_MIN and GOAWS_RANDOM_LATENCY_MAX), which, if set
will prevent messages from being released from the queue until after a
period of random, simulated latency has elapsed.

The purpose of this change is to aid in local testing against AWS when
SQS latency is expected and needs to be developed against.
app/sqs.go Outdated
}

func getRandomLatency() (time.Duration, error){
minVar := os.Getenv("GOAWS_RANDOM_LATENCY_MIN")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry this took so long to evaluate but the values should be in the goaws.conf not in environment variables. This is for consistency sake with how all configs are done. thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@p4tin no worries, I've just pushed another commit - is this what you had in mind?

@andykuszyk
Copy link
Contributor Author

@p4tin does this PR look ok now?

@andykuszyk andykuszyk requested a review from p4tin January 13, 2020 11:43
@p4tin p4tin merged commit 6ecd9bf into Admiral-Piett:master Mar 1, 2020
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

3 participants