From 5b968ccf1481a8bae7fce49cca01cf3597da4be8 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 10 Apr 2024 17:24:01 +0200 Subject: syz-manager: collect avg instance create time We will also use it to determine when we are ready to schedule programs that are very likely to crash instances. --- syz-manager/stats.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'syz-manager/stats.go') diff --git a/syz-manager/stats.go b/syz-manager/stats.go index 7cb67d5ca..1169f4125 100644 --- a/syz-manager/stats.go +++ b/syz-manager/stats.go @@ -20,6 +20,7 @@ type Stats struct { statSuppressed *stats.Val statUptime *stats.Val statFuzzingTime *stats.Val + statAvgBootTime *stats.Val } func (mgr *Manager) initStats() { @@ -48,6 +49,14 @@ func (mgr *Manager) initStats() { }, func(v int, period time.Duration) string { return fmt.Sprintf("%v sec", v) }) + mgr.statAvgBootTime = stats.Create("instance restart", "Average VM restart time (sec)", + stats.NoGraph, + func() int { + return int(mgr.bootTime.Value().Seconds()) + }, + func(v int, _ time.Duration) string { + return fmt.Sprintf("%v sec", v) + }) stats.Create("heap", "Process heap size (bytes)", stats.Graph("memory"), func() int { -- cgit mrf-deployment