aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/pkg/db
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-08-20 12:34:18 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-08-20 11:01:51 +0000
commite4aed695dda3b9b6c5185feb5f5f993955843594 (patch)
tree0e56007ed2b370ad556a0be45bbd41dc7c1af081 /syz-cluster/pkg/db
parent1157ee352849f8b61e467c77531165ac237d9246 (diff)
syz-cluster: display the session processing time
Diffstat (limited to 'syz-cluster/pkg/db')
-rw-r--r--syz-cluster/pkg/db/entities.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/syz-cluster/pkg/db/entities.go b/syz-cluster/pkg/db/entities.go
index b1ffc6949..53e52b4ea 100644
--- a/syz-cluster/pkg/db/entities.go
+++ b/syz-cluster/pkg/db/entities.go
@@ -102,6 +102,13 @@ func (s *Session) Status() SessionStatus {
return SessionStatusFinished
}
+func (s *Session) Duration() time.Duration {
+ if s.FinishedAt.IsNull() {
+ return 0
+ }
+ return s.FinishedAt.Time.Sub(s.StartedAt.Time).Truncate(time.Minute)
+}
+
func (s *Session) SetStartedAt(t time.Time) {
s.StartedAt = spanner.NullTime{Time: t, Valid: true}
}