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