-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat: Add caching to internet_speed #10530
Conversation
Thanks so much for the pull request! |
!signed-cla |
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.
Thanks for this PR @Jleagle. I have some comments in the code. However, there is a more general comment regarding the offset. I think this should be a Telegraf-wide option to allow an offset to the rounded gather interval globally and plugin-wise. So I'm setting the corresponding tag to make Influx people take a look.
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
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.
Very nice @Jleagle. There is only one offset
left-over in the readme, but other than that we are fine to go I think.
Just one more request: If the collection_offset
worked for you, please drop a note in the corresponding PR. Thanks for your effort!
📦 Looks like new artifacts were built from this PR. Expand this list to get them here ! 🐯Artifact URLs |
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.
Looks good to me. Thanks @Jleagle for your contribution!
I'm a bit late to the party, but now the selected server is used for the whole duration of telegraf run. I can imagine after a few days that server is not available and another one should be picked. Could someone implement server re-election and/or cache expiry (Duration)? |
I think re-electing the server on error is a valid point. |
Required for all PRs:
This PR adds two config options, offset & cache.
Offset is to help spread the calls to the speedtest server, this also reduces errors that seem to happen at specific times like on the hour, presumably where everyone does a test at the same time.
Cache caches the closest speedtest server, there doesn't seem to be much point in querying all the servers to get the closest one when it's going to be the same every time.
They both default to false to help with backwards compatibility.