Skip to content

feat(filegen): add %EPOCH_S/MS/US/NS Unix epoch time directives (PIPE-1408) - #296

Merged
Dylan-M merged 1 commit into
mainfrom
dylanmyers/pipe-1408-epoch-time-directives
Aug 13, 2026
Merged

feat(filegen): add %EPOCH_S/MS/US/NS Unix epoch time directives (PIPE-1408)#296
Dylan-M merged 1 commit into
mainfrom
dylanmyers/pipe-1408-epoch-time-directives

Conversation

@Dylan-M

@Dylan-M Dylan-M commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Proposed Change

The data library's time-format directives had no Unix epoch token. %s is 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 processTimestamps before the line reaches ctime, from the same now the other directives use. %s and every other directive are left untouched.

How the reviewer can validate

Note: the manual validation procedure below is an AI-generated script. Review it before running.

Manual:

  1. make build
  2. printf '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
  3. ./blitz --generator-type filegen --generator-filegen-source /tmp/epoch.log --generator-filegen-rate 300ms --output-type stdout
  4. Confirm each token becomes an integer of the right width (10/13/16/19 digits), all from one instant. %Y-… should still format normally. Example: ts_s=1786630895 ts_ms=1786630895215 ts_us=1786630895215112 ts_ns=1786630895215112371.

Automated: go test ./generator/filegen/. TestReplaceEpochDirectives asserts the exact integer per unit and integer form; TestReplaceEpochDirectives_LeavesSubSecondUntouched guards %s; the TestTimestampProcessing epoch case covers end-to-end substitution.

Checklist
  • Changes are tested
  • CI has passed

@Dylan-M
Dylan-M requested review from a team as code owners August 13, 2026 14:28
@Dylan-M
Dylan-M force-pushed the dylanmyers/pipe-1408-epoch-time-directives branch from f1c3b9a to a0b1a46 Compare August 13, 2026 15:36

Dylan-M commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Aug 13, 8:52 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 13, 8:53 PM UTC: @Dylan-M added this pull request to the GitHub merge queue with Graphite.

@Dylan-M
Dylan-M added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit a772cde Aug 13, 2026
18 checks passed
@Dylan-M
Dylan-M deleted the dylanmyers/pipe-1408-epoch-time-directives branch August 13, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants