Skip to content

feat: Add caching to internet_speed#10530

Merged
sspaink merged 14 commits intoinfluxdata:masterfrom
Jleagle:master
Feb 1, 2022
Merged

feat: Add caching to internet_speed#10530
sspaink merged 14 commits intoinfluxdata:masterfrom
Jleagle:master

Conversation

@Jleagle
Copy link
Copy Markdown
Contributor

@Jleagle Jleagle commented Jan 26, 2022

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.

@telegraf-tiger
Copy link
Copy Markdown
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jan 26, 2022
@Jleagle
Copy link
Copy Markdown
Contributor Author

Jleagle commented Jan 26, 2022

!signed-cla

@Jleagle Jleagle marked this pull request as ready for review January 27, 2022 10:23
Copy link
Copy Markdown
Member

@srebhan srebhan left a 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.

@srebhan srebhan self-assigned this Jan 27, 2022
@srebhan srebhan added needs design review plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jan 27, 2022
@srebhan
Copy link
Copy Markdown
Member

srebhan commented Jan 27, 2022

The corresponding issue is #10406 and #1319.

Jleagle and others added 8 commits January 27, 2022 13:26
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>
@srebhan
Copy link
Copy Markdown
Member

srebhan commented Jan 30, 2022

@Jleagle can you maybe check if you can get rid of the offset parameter in your PR when rebasing on #10545 and using collection_offset!?

Copy link
Copy Markdown
Member

@srebhan srebhan left a 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!

@Jleagle Jleagle changed the title feat: Add time offset and caching to internet_speed feat: Add caching to internet_speed Feb 1, 2022
@telegraf-tiger
Copy link
Copy Markdown
Contributor

telegraf-tiger bot commented Feb 1, 2022

Copy link
Copy Markdown
Member

@srebhan srebhan left a 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!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Feb 1, 2022
@sspaink sspaink merged commit 85ee825 into influxdata:master Feb 1, 2022
@Hipska
Copy link
Copy Markdown
Contributor

Hipska commented May 20, 2022

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)?

@srebhan
Copy link
Copy Markdown
Member

srebhan commented May 20, 2022

I think re-electing the server on error is a valid point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants