diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 16:13:40 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 16:13:40 +0200 |
| commit | 2c2cbe07f5e10fdb996e2a039cde84be44866f18 (patch) | |
| tree | 97654c2c9ba9fc91cb569ab0521c4c67247abc0b /internal/flamegraph/collapsed.go | |
| parent | eebc9cba272c1b20296ab998262298c5da99e047 (diff) | |
Add integration test framework: plan, workload binary, harness scaffolding
- INTEGRATIONTESTS-PLAN.md: full design for e2e integration tests
- integrationtests/cmd/ioworkload: standalone binary with 13 I/O scenarios
- integrationtests/expectations.go: ExpectedEvent type and assertion helpers
- integrationtests/parse.go: .ior.zst parser producing TestResult
- Export IterRecord and LoadFromFile in flamegraph package
- Fix TraceId -> TraceID, StringByName returns error instead of panic
Amp-Thread-ID: https://ampcode.com/threads/T-019c8031-c106-757a-95a0-7a5457163ce7
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/flamegraph/collapsed.go')
| -rw-r--r-- | internal/flamegraph/collapsed.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/flamegraph/collapsed.go b/internal/flamegraph/collapsed.go index aa0d81c..f04a38d 100644 --- a/internal/flamegraph/collapsed.go +++ b/internal/flamegraph/collapsed.go @@ -59,11 +59,15 @@ func (c Collapsed) Write(iorDataFile string) (string, error) { for record := range iod.iter() { var fieldValues []string for _, fieldName := range c.fields { - fieldValues = append(fieldValues, record.StringByName(fieldName)) + v, err := record.StringByName(fieldName) + if err != nil { + return outFile, fmt.Errorf("field %s: %w", fieldName, err) + } + fieldValues = append(fieldValues, v) } writer.Write([]byte(fmt.Sprintf("%s %d\n", strings.Join(fieldValues, ";"), - record.cnt.ValueByName(c.countField), + record.Cnt.ValueByName(c.countField), ))) } writer.Flush() |
