Skip to content

Commit 1d3afb3

Browse files
committed
changed settings
1 parent 7a931c8 commit 1d3afb3

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
memsql-loadtester
2-
config.json
2+
config.json
3+
configs

Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
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 .
67
CMD ["/app/main"]

main.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
)
1515

1616
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"`
2222
}
2323

2424
var config Config
@@ -91,8 +91,10 @@ func displayAverageQueryTime() {
9191
}
9292

9393
func dispatchQueries() {
94+
fmt.Println("Starting run")
95+
9496
start := time.Now()
95-
shouldEnd := start.Add(time.Second * time.Duration(config.TimeToRun))
97+
shouldEnd := start.Add(time.Second * time.Duration(config.TimeToRunInSeconds))
9698

9799
for time.Now().Before(shouldEnd) {
98100
for i := 0; i < config.RequestsPerSecond; i++ {

0 commit comments

Comments
 (0)