Add StaticTimestamped generator that uses timestamps from a file to send logs#1687
Add StaticTimestamped generator that uses timestamps from a file to send logs#1687
Conversation
78768d6 to
b3de2e0
Compare
78c5594 to
fa19c37
Compare
8071239 to
ff8a57f
Compare
fa19c37 to
7e1a732
Compare
1be6e74 to
30363c3
Compare
7e1a732 to
1098a47
Compare
30363c3 to
4aba943
Compare
1098a47 to
02c10d3
Compare
4aba943 to
b413062
Compare
02c10d3 to
9aa2aee
Compare
b413062 to
85dfb43
Compare
9aa2aee to
49cdb8f
Compare
85dfb43 to
fac862b
Compare
49cdb8f to
9e8ecc9
Compare
fac862b to
c5eee9b
Compare
6bc7260 to
b173aed
Compare
8e1b11c to
84e040f
Compare
b173aed to
9e7b813
Compare
9e7b813 to
72668f1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 739872f122
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
efc7cc8 to
f1c39bb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1c39bb28f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6c49d5b to
75583e6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75583e6697
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
75583e6 to
40e6e49
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40e6e498ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
40e6e49 to
7b5501b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b5501b16b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7b5501b to
2b48880
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b48880d37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let (ts, remainder) = NaiveDateTime::parse_and_remainder(line, timestamp_format) | ||
| .map_err(|_| Error::Timestamp(line.to_string()))?; |
There was a problem hiding this comment.
Support chrono formats that omit a full date-time
parse_line_with_format() only falls back to DateTime<FixedOffset> and NaiveDateTime, so formats that do not describe a complete date-time (for example common syslog prefixes like %b %e %H:%M:%S or time-only %H:%M:%S) are rejected as Timestamp errors even though timestamp_format is documented as a general chrono format. In practice this makes the new generator unusable for many real log files unless they already include a full date, which is a surprising limitation for replaying existing logs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is more of a theoretical issue / feature request than a bug.
f1090e9 to
d1e52d1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1e52d1a91
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let (ts, remainder) = NaiveDateTime::parse_and_remainder(line, timestamp_format) | ||
| .map_err(|_| Error::Timestamp(line.to_string()))?; | ||
| let body = remainder |
There was a problem hiding this comment.
Avoid leaking full log lines in parse errors
When timestamp parsing fails, parse_line_with_format builds Error::Timestamp(line.to_string()), and that string is later propagated as crate::Error::Validation(err.to_string()). In practice, a misconfigured timestamp_format causes startup errors that include the entire source log line, which can expose sensitive payload content (tokens, user data, etc.) in logs and error surfaces; returning a line number or truncated sample is safer.
Useful? React with 👍 / 👎.
d1e52d1 to
be80891
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be80891c6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let block = self | ||
| .next_block | ||
| .take() | ||
| .expect("fill_next_block guarantees a block"); |
There was a problem hiding this comment.
Preserve next second when block probe yields empty output
In fixed-cache mode, block construction intentionally retries many sampled sizes (construct_block_cache_inner treats empty output as SpinError::EmptyBlock and probes again), but this serializer consumes stream state before knowing whether anything can be written. Because self.next_block is unconditionally take()n here, a probe with max_bytes == 0 (or any size smaller than every line in that second) returns an empty block and permanently drops that entire second on retry, which corrupts the replay timing profile.
Useful? React with 👍 / 👎.
blt
left a comment
There was a problem hiding this comment.
One small nit comment, not blocking.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79b6e1e3e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
79b6e1e to
cdc67f0
Compare

What does this PR do?
Adds a new "static" generator that parses timestamps from a log file, and chunks each second worth of logs into a single block.
Motivation
This allows you to e.g. download an hour worth of logs, parse their timestamps, and then (in conjunction w/ prior block-based throttling) send 1 block per second to get a "realistic" load pattern as opposed to generating X bytes/second.
Related issues
Follow up of #1683