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

Use Tickers to populate EC2 pricing maps #274

Open
paulajulve opened this issue Aug 13, 2024 · 0 comments
Open

Use Tickers to populate EC2 pricing maps #274

paulajulve opened this issue Aug 13, 2024 · 0 comments
Assignees
Labels
area/capacity enhancement New feature or request

Comments

@paulajulve
Copy link
Contributor

paulajulve commented Aug 13, 2024

Follow up to #235

Currently these are populated within the main routine in the Collect method on the ec2 package. It means that every time the exporter goes to collect the metrics, it stops to first check if the compute one is outdated, if it is, populate it, and then the same for the storage one, before moving on to actually collecting the metrics that we want to expose.

This responsibility should not belong to the Collect method. Instead, we could follow the same pattern as the aks package:

  • create the maps within the New function instead of the Collect one
  • create tickers for each
  • delegate population to the methods of the map structs themselves
  • spin up a background go routine for them to re-populate in the background whenever they expire, independent of each other and of the Collect function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/capacity enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant