Repository navigation
influx: use upstream buffering (#406) and add tests - #9
Merged
Merged
Conversation
Replace the fork's influx buffering with andig's implementation from volkszaehler#406 so the fork matches upstream's semantics for `influx.buffer`: - default 0 keeps the client default (5 retries within 3 minutes) - buffer > 0 retries indefinitely and keeps the batches of the last `buffer` duration Note: the fork previously defaulted to 1h. Set `buffer: 1h` explicitly to keep buffering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzyNHxELw6PasHKku3kreU
- TestInfluxBufferOptions checks the retry queue size, retry count and retry time derived from the buffer duration, including the client defaults for 0 and the one-batch minimum - TestInfluxOutage simulates a 20s database outage against a fake server and checks that every point is delivered with a 1h buffer - TestInfluxOutageDefault checks that the same outage loses data with the client defaults, so the outage test is meaningful The outage tests are skipped with -short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzyNHxELw6PasHKku3kreU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches the fork's influx write buffering to andig's implementation from volkszaehler#406 and adds tests for it.
Why: volkszaehler#406 uses the same
--influx-bufferflag andinflux.bufferkey as our volkszaehler#408 but with different semantics. Taking upstream's version now means configs behave the same once volkszaehler#406 is merged and the fork syncs.Behaviour change: the default is now
0, which keeps the InfluxDB client default (5 retries within 3 minutes, about 10s of data). Before, the fork defaulted to1h. Setbuffer: 1hexplicitly to keep buffering.Tests (
server/influx_test.go, no changes to volkszaehler#406's code):TestInfluxBufferOptions: retry queue size (in batches), retry count and retry time for 0, 500ms, 10m and 1hTestInfluxOutage: 20s outage against a fake InfluxDB, every point arrives with a 1h buffer (~25s)TestInfluxOutageDefault: the same outage loses data with the default, which shows the outage test is meaningful (~80s)The outage tests are skipped with
-short.go vetandgo test ./...pass.The test commit applies on its own and can be offered to volkszaehler#406.
Generated by Claude Code