Debian Codegraph @

stress/v2/statement/wait.go

raw symbols SCIP
1 package statement
2
3 import (
4 "fmt"
5 "time"
6
7 "github.com/influxdata/influxdb/stress/v2/stress_client"
8 )
9
10 // WaitStatement is a Statement Implementation to prevent the test from returning to early when running GoStatements
11 type WaitStatement struct {
12 StatementID string
13
14 runtime time.Duration
15 }
16
17 // SetID statisfies the Statement Interface
18 func (w *WaitStatement) SetID(s string) {
19 w.StatementID = s
20 }
21
22 // Run statisfies the Statement Interface
23 func (w *WaitStatement) Run(s *stressClient.StressTest) {
24 runtime := time.Now()
25 s.Wait()
26 w.runtime = time.Since(runtime)
27 }
28
29 // Report statisfies the Statement Interface
30 func (w *WaitStatement) Report(s *stressClient.StressTest) string {
31 return fmt.Sprintf("WAIT -> %v", w.runtime)
32 }