diff options
Diffstat (limited to 'integrationtests/parse.go')
| -rw-r--r-- | integrationtests/parse.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/integrationtests/parse.go b/integrationtests/parse.go new file mode 100644 index 0000000..cebb0ba --- /dev/null +++ b/integrationtests/parse.go @@ -0,0 +1,25 @@ +package integrationtests + +import ( + "fmt" + "ior/internal/flamegraph" +) + +// TestResult holds all captured I/O records from a single ior run. +type TestResult struct { + Records []flamegraph.IterRecord +} + +// LoadTestResult parses an .ior.zst file into a TestResult. +func LoadTestResult(iorZstFile string) (TestResult, error) { + iter, err := flamegraph.LoadFromFile(iorZstFile) + if err != nil { + return TestResult{}, fmt.Errorf("load test result: %w", err) + } + + var result TestResult + for record := range iter { + result.Records = append(result.Records, record) + } + return result, nil +} |
