diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-20 07:41:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-20 07:41:04 +0300 |
| commit | 5fd613562e2aa2ab3aac3349f44db88330046c1c (patch) | |
| tree | dfb391de44b309d391031b7744bc48f3ea7c8d7d /internal/parquet | |
| parent | df1225efe494cc81513cf98e93891376e45f9615 (diff) | |
task 07: assert mmap address-space accounting end-to-end
Diffstat (limited to 'internal/parquet')
| -rw-r--r-- | internal/parquet/recorder_test.go | 29 | ||||
| -rw-r--r-- | internal/parquet/schema.go | 62 |
2 files changed, 47 insertions, 44 deletions
diff --git a/internal/parquet/recorder_test.go b/internal/parquet/recorder_test.go index 76d70a5..96ae87c 100644 --- a/internal/parquet/recorder_test.go +++ b/internal/parquet/recorder_test.go @@ -134,20 +134,21 @@ func TestRecorderStopReturnsTerminalErrorOnRepeatedCalls(t *testing.T) { func testStreamRow(seq uint64, syscall string, isError bool) streamrow.Row { return streamrow.Row{ - Seq: seq, - TimeNs: seq * 10, - Syscall: syscall, - Family: "FS", - Comm: "ior-test", - PID: 100 + uint32(seq), - TID: 200 + uint32(seq), - FileName: "/tmp/file", - DurationNs: seq + 1, - GapNs: seq + 2, - Bytes: seq + 3, - RetVal: int64(seq), - IsError: isError, - FD: int32(seq), + Seq: seq, + TimeNs: seq * 10, + Syscall: syscall, + Family: "FS", + Comm: "ior-test", + PID: 100 + uint32(seq), + TID: 200 + uint32(seq), + FileName: "/tmp/file", + DurationNs: seq + 1, + GapNs: seq + 2, + Bytes: seq + 3, + AddressSpaceBytes: seq + 4, + RetVal: int64(seq), + IsError: isError, + FD: int32(seq), } } diff --git a/internal/parquet/schema.go b/internal/parquet/schema.go index 03937bf..87d4e2f 100644 --- a/internal/parquet/schema.go +++ b/internal/parquet/schema.go @@ -13,21 +13,22 @@ import ( // Record is the persisted Parquet schema for one syscall stream row. type Record struct { - Seq uint64 `parquet:"seq"` - TimeNS uint64 `parquet:"time_ns"` - GapNS uint64 `parquet:"gap_ns"` - LatencyNS uint64 `parquet:"latency_ns"` - Comm string `parquet:"comm"` - PID uint32 `parquet:"pid"` - TID uint32 `parquet:"tid"` - Syscall string `parquet:"syscall"` - Family string `parquet:"family"` - FD int32 `parquet:"fd"` - Ret int64 `parquet:"ret"` - Bytes uint64 `parquet:"bytes"` - File string `parquet:"file"` - IsError bool `parquet:"is_error"` - FilterEpoch uint64 `parquet:"filter_epoch"` + Seq uint64 `parquet:"seq"` + TimeNS uint64 `parquet:"time_ns"` + GapNS uint64 `parquet:"gap_ns"` + LatencyNS uint64 `parquet:"latency_ns"` + Comm string `parquet:"comm"` + PID uint32 `parquet:"pid"` + TID uint32 `parquet:"tid"` + Syscall string `parquet:"syscall"` + Family string `parquet:"family"` + FD int32 `parquet:"fd"` + Ret int64 `parquet:"ret"` + Bytes uint64 `parquet:"bytes"` + AddressSpaceBytes uint64 `parquet:"address_space_bytes"` + File string `parquet:"file"` + IsError bool `parquet:"is_error"` + FilterEpoch uint64 `parquet:"filter_epoch"` } // FileMetadata captures constant metadata written once into the parquet file. @@ -55,21 +56,22 @@ func NewFileMetadata(mode string) FileMetadata { // RecordFromStream converts one shared stream row into the persisted format. func RecordFromStream(row streamrow.Row, filterEpoch uint64) Record { return Record{ - Seq: row.Seq, - TimeNS: row.TimeNs, - GapNS: row.GapNs, - LatencyNS: row.DurationNs, - Comm: row.Comm, - PID: row.PID, - TID: row.TID, - Syscall: row.Syscall, - Family: row.Family, - FD: row.FD, - Ret: row.RetVal, - Bytes: row.Bytes, - File: row.FileName, - IsError: row.IsError, - FilterEpoch: filterEpoch, + Seq: row.Seq, + TimeNS: row.TimeNs, + GapNS: row.GapNs, + LatencyNS: row.DurationNs, + Comm: row.Comm, + PID: row.PID, + TID: row.TID, + Syscall: row.Syscall, + Family: row.Family, + FD: row.FD, + Ret: row.RetVal, + Bytes: row.Bytes, + AddressSpaceBytes: row.AddressSpaceBytes, + File: row.FileName, + IsError: row.IsError, + FilterEpoch: filterEpoch, } } |
