File tree 3 files changed +15
-11
lines changed
3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 1
1
memsql-loadtester
2
- config.json
2
+ config.json
3
+ configs
Original file line number Diff line number Diff line change 1
1
FROM golang:latest
2
- RUN mkdir /app
3
- ADD . /app/
4
- WORKDIR /app
5
- RUN go build -o main .
2
+ RUN mkdir /app
3
+ ADD . /app/
4
+ WORKDIR /app
5
+ RUN go get github.com/go-sql-driver/mysql
6
+ RUN go build -o main .
6
7
CMD ["/app/main" ]
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ import (
14
14
)
15
15
16
16
type Config struct {
17
- RequestsPerSecond int `json:"requestsPerSecond"`
18
- Queries []string `json:"queries"`
19
- ConnectionString string `json:"connectionString"`
20
- PrintLogs bool `json:"printLogs"`
21
- TimeToRun int `json:"timeToRun "`
17
+ RequestsPerSecond int `json:"requestsPerSecond"`
18
+ Queries []string `json:"queries"`
19
+ ConnectionString string `json:"connectionString"`
20
+ PrintLogs bool `json:"printLogs"`
21
+ TimeToRunInSeconds int `json:"timeToRunInSeconds "`
22
22
}
23
23
24
24
var config Config
@@ -91,8 +91,10 @@ func displayAverageQueryTime() {
91
91
}
92
92
93
93
func dispatchQueries () {
94
+ fmt .Println ("Starting run" )
95
+
94
96
start := time .Now ()
95
- shouldEnd := start .Add (time .Second * time .Duration (config .TimeToRun ))
97
+ shouldEnd := start .Add (time .Second * time .Duration (config .TimeToRunInSeconds ))
96
98
97
99
for time .Now ().Before (shouldEnd ) {
98
100
for i := 0 ; i < config .RequestsPerSecond ; i ++ {
You can’t perform that action at this time.
0 commit comments