feat: record launch latency in statistics for start-only jobs

StartOnly jobs previously forced DurationMS to 0 because GoSentry does
not wait for the process to exit, leaving the Statistics line stuck at
"last 0 ms, avg 0 ms". The runner already measures launch latency (time
to spawn the process) for the History detail; this now returns that
value as the run duration so the existing duration-driven stats pipeline
folds it into last/avg/max.

Sub-millisecond launches still round to 0 and are excluded from the
average, matching prior behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-06-30 00:05:01 +03:00
parent 00991f24a5
commit 6ea6578acb
4 changed files with 23 additions and 11 deletions
+3 -1
View File
@@ -32,7 +32,9 @@ type JobRuntime struct {
AvgDurationMS int64
MaxDurationMS int64
// TimedRunCount is the number of runs that contributed to AvgDurationMS.
// StartOnly and legacy duration-less runs increment RunCount but not this.
// Runs with no recorded duration (legacy logs, or sub-millisecond StartOnly
// launches that round to 0) increment RunCount but not this. StartOnly runs
// otherwise contribute their launch latency.
TimedRunCount int
}