forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(demo gcp_pubsub internal_metrics source throttle transform): Fix …
…`interval` fractional second parsing (vectordotdev#17917) The demo logs source `interval` parameter examples imply that demo logs faster than 1/sec are possible by specifying a fractional value. However, the demo logs source incorrectly parses this value using serde's [DurationSeconds](https://docs.rs/serde_with/latest/serde_with/struct.DurationSeconds.html). This is incorrect - fractional second parts are coerced into a full-integer value based on rounding rules. So currently, `interval` values of >= 0.5 to 1 behave the same as `interval = 1`, while `interval` values of < 0.5 behave the same as `interval = 0`. The correct serde struct to use is [DurationSecondsWithFrac](https://docs.rs/serde_with/latest/serde_with/struct.DurationSecondsWithFrac.html). (edit): This has since expanded to complete replacement of all usages of `DurationSeconds<f64, Strict>` with `DurationSecondsWithFrac<f64, Strict>`. This now also affects `gcp_pubsub` and `internal_metrics` sources, as well as the `throttle` transform.
- Loading branch information
Showing
5 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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