diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-19 09:47:09 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-19 09:47:09 +0300 |
| commit | 5bd44dcb1e588fd5df8c02aec58353f7aa8f7d13 (patch) | |
| tree | d4059fce1d43a1f0f0815d753b627802e7599b13 /cmd/ioworkload/main.go | |
| parent | d699ef44a9ded5d419a470a4f6715ecff7f0fcd1 (diff) | |
t6 stabilize family recording integration
Diffstat (limited to 'cmd/ioworkload/main.go')
| -rw-r--r-- | cmd/ioworkload/main.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cmd/ioworkload/main.go b/cmd/ioworkload/main.go index 0276a9c..57424e4 100644 --- a/cmd/ioworkload/main.go +++ b/cmd/ioworkload/main.go @@ -8,13 +8,17 @@ import ( "fmt" "os" "slices" + "strconv" "time" ) // Give ior enough time to attach tracepoints before scenarios emit syscalls. // Under slower CI or locally saturated systems, 5s can still miss first-call // events for single-shot scenarios. Use a slightly larger delay for stability. -const startupDelay = 8 * time.Second +const ( + defaultStartupDelay = 8 * time.Second + startupDelayEnv = "IOR_WORKLOAD_STARTUP_DELAY_MS" +) func main() { scenario := flag.String("scenario", "", "I/O scenario to execute") @@ -40,10 +44,22 @@ func main() { } fmt.Println(os.Getpid()) - time.Sleep(startupDelay) + time.Sleep(configuredStartupDelay()) if err := run(); err != nil { fmt.Fprintf(os.Stderr, "scenario %s failed: %v\n", *scenario, err) os.Exit(1) } } + +func configuredStartupDelay() time.Duration { + raw := os.Getenv(startupDelayEnv) + if raw == "" { + return defaultStartupDelay + } + ms, err := strconv.Atoi(raw) + if err != nil || ms < 0 { + return defaultStartupDelay + } + return time.Duration(ms) * time.Millisecond +} |
