feat(filegen): add %EPOCH_S/MS/US/NS Unix epoch time directives (PIPE-1408) - #296
Merged
Merged
Conversation
2 tasks
…-1408) Assisted-by: Claude Opus 4.8
Dylan-M
force-pushed
the
dylanmyers/pipe-1408-epoch-time-directives
branch
from
August 13, 2026 15:36
f1c3b9a to
a0b1a46
Compare
Caleb-Hurshman
approved these changes
Aug 13, 2026
Contributor
Author
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.
Proposed Change
The data library's time-format directives had no Unix epoch token.
%sis already the sub-second token, so it can't carry strftime's epoch-seconds meaning. This adds four unit-encoded directives:%EPOCH_S,%EPOCH_MS,%EPOCH_US,%EPOCH_NS.Epoch values are integers the ctime layout formatter can't express, and ctime rejects any format containing digits. So they're substituted in
processTimestampsbefore the line reaches ctime, from the samenowthe other directives use.%sand every other directive are left untouched.How the reviewer can validate
Manual:
make buildprintf 'ts_s=%%EPOCH_S ts_ms=%%EPOCH_MS ts_us=%%EPOCH_US ts_ns=%%EPOCH_NS iso=%%Y-%%m-%%dT%%H:%%M:%%SZ\n' > /tmp/epoch.log./blitz --generator-type filegen --generator-filegen-source /tmp/epoch.log --generator-filegen-rate 300ms --output-type stdout%Y-…should still format normally. Example:ts_s=1786630895 ts_ms=1786630895215 ts_us=1786630895215112 ts_ns=1786630895215112371.Automated:
go test ./generator/filegen/.TestReplaceEpochDirectivesasserts the exact integer per unit and integer form;TestReplaceEpochDirectives_LeavesSubSecondUntouchedguards%s; theTestTimestampProcessingepoch case covers end-to-end substitution.Checklist