Debian Codegraph @

stress/v2/statement/statement.go

raw symbols SCIP
1 package statement
2
3 import (
4 "log"
5 "strconv"
6
7 "github.com/influxdata/influxdb/stress/v2/stress_client"
8 )
9
10 // Statement is the common interface to shape the testing environment and prepare database requests
11 // The parser turns the 'statements' in the config file into Statements
12 type Statement interface {
13 Run(s *stressClient.StressTest)
14 Report(s *stressClient.StressTest) string
15 SetID(s string)
16 }
17
18 func parseInt(s string) int {
19 i, err := strconv.ParseInt(s, 10, 64)
20 if err != nil {
21 log.Fatalf("Error parsing integer:\n String: %v\n Error: %v\n", s, err)
22 }
23 return int(i)
24 }
25
26 func parseFloat(s string) int {
27 i, err := strconv.ParseFloat(s, 64)
28 if err != nil {
29 log.Fatalf("Error parsing integer:\n String: %v\n Error: %v\n", s, err)
30 }
31 return int(i)
32 }