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

Add cache to exporter #66

Merged
merged 19 commits into from
Dec 4, 2023
Merged

Add cache to exporter #66

merged 19 commits into from
Dec 4, 2023

Conversation

inkel
Copy link
Collaborator

@inkel inkel commented Dec 1, 2023

This PR adds a cache system to the exporter to prevent timeouts when calling *exporter.Collect. Each given provider will poll in its own goroutine and write the results to the cache; then in the *exporter.Collect method we read the values from the cache.

@inkel inkel self-assigned this Dec 1, 2023
@inkel inkel force-pushed the inkel/exporter/cache branch 2 times, most recently from d9ca594 to ad7bd5d Compare December 1, 2023 19:54
@inkel inkel changed the base branch from main to dev/hackathon-dec-2023 December 1, 2023 19:54
inkel added 2 commits December 1, 2023 16:58
These will be used to cache the results of polling each provider for
unused disks, making the *exporter.Collect method faster and less
prone to timeouts.
@inkel inkel force-pushed the inkel/exporter/cache branch from 806acbd to e50e891 Compare December 1, 2023 19:58
@inkel inkel marked this pull request as ready for review December 4, 2023 13:44
@inkel
Copy link
Collaborator Author

inkel commented Dec 4, 2023

This probably needs a bit more of work, but I'll work on them while your PR(s) get merged, @logyball 😸

inkel and others added 10 commits December 4, 2023 12:05
This should make the code more readable.
The previous code was using defer, which would release the
context.WithTimeout when the program ends, not on each iteration, thus
causing deferred functions to pile up, consuming unnecessary memory.
This makes the code more readable.
removing binary accidentally committed
Logyball/cache updates followup / Verbose logging flag
@logyball
Copy link
Contributor

logyball commented Dec 4, 2023

This probably needs a bit more of work, but I'll work on them while your PR(s) get merged, @logyball 😸

merged :D

Copy link
Contributor

@logyball logyball left a comment

Choose a reason for hiding this comment

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

LGTM!

Two small NITs but neither is blocking

@inkel inkel merged commit 72805a0 into dev/hackathon-dec-2023 Dec 4, 2023
@inkel inkel deleted the inkel/exporter/cache branch December 4, 2023 19:07
@inkel inkel mentioned this pull request Dec 4, 2023
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.

3 participants