-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Implement new concurrency limit mechanism for the CloudWatch client #1107
Implement new concurrency limit mechanism for the CloudWatch client #1107
Conversation
// perAPICallLimiter is a ConcurrencyLimiter that keeps a different concurrency limiter per different API call. This allows | ||
// a more granular control of concurrency, allowing us to take advantage of different api limits. For example, ListMetrics | ||
// has a limit of 25 TPS, while GetMetricData has none. | ||
type perAPICallLimiter map[string]chan struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we potentially use three different singleLimiter
instead of the perAPICallLimiter
? I think that would be a bit more readable perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, completely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so extracted the common funcionality into a simple semaphore type, and re-used that everywhere.
1578282
to
d551711
Compare
@cristiangreco what do you think of the latest changes here? |
Co-authored-by: Cristian Greco <[email protected]>
This PR implements a new concurrency mechanism for the CloudWatch client. For this, the client is decoupled of how the concurrency is limited, and two implementations are provided:
The second one will allow us to take full advantage of the rate limits imposed by AWS into each api.