summaryrefslogtreecommitdiff
path: root/internal/parquet/schema.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-18 20:54:35 +0200
committerPaul Buetow <paul@buetow.org>2026-03-18 20:54:35 +0200
commitcd554b0af706b5f62b4e1bfde04091052b4aac61 (patch)
treee6d02f1c2a1da27da17386e8832c2d4a3e699cdf /internal/parquet/schema.go
parentb421b2232351049277ee4ad5b31367bb2b6779bb (diff)
cleanup
Diffstat (limited to 'internal/parquet/schema.go')
-rw-r--r--internal/parquet/schema.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/parquet/schema.go b/internal/parquet/schema.go
index 2ede444..62d448b 100644
--- a/internal/parquet/schema.go
+++ b/internal/parquet/schema.go
@@ -1,7 +1,9 @@
package parquet
import (
+ "os"
"strconv"
+ "time"
"ior/internal/flags"
"ior/internal/streamrow"
@@ -35,6 +37,20 @@ type FileMetadata struct {
IORVersion string
}
+// NewFileMetadata constructs file-level metadata for a parquet trace file,
+// populating the hostname, timestamp, version, and recording mode.
+func NewFileMetadata(mode string) FileMetadata {
+ meta := FileMetadata{
+ StartedAtUnixNano: uint64(time.Now().UnixNano()),
+ Mode: mode,
+ IORVersion: flags.Version,
+ }
+ if hostname, err := os.Hostname(); err == nil {
+ meta.Hostname = hostname
+ }
+ return meta
+}
+
// RecordFromStream converts one shared stream row into the persisted format.
func RecordFromStream(row streamrow.Row, filterEpoch uint64) Record {
return Record{