Skip to content

Commit 37c1719

Browse files
committed
change size to the size of all workers
Signed-off-by: FingerLeader <[email protected]>
1 parent 6418c5d commit 37c1719

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

main.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ func main() {
100100
for {
101101
workQueue <- struct{}{}
102102
go func() {
103-
err := exec.Command("./memStress", "--size", memSize, "--time", growthTime, "--client", "1").Run()
103+
err := exec.Command("./memStress", "--size", memSize, "--workers", fmt.Sprintf("%d", workers),
104+
"--time", growthTime, "--client", "1").Run()
104105
if err != nil {
105106
fmt.Println(err)
106107
}
107108
<-workQueue
108109
}()
109110
time.Sleep(time.Second)
110111
}
111-
112112
} else {
113113
memInfo, _ := psutil.VirtualMemory()
114114
var length uint64
@@ -132,10 +132,6 @@ func main() {
132132
if err != nil {
133133
// TODO
134134
}
135-
run(length, timeLine)
136-
137-
for {
138-
time.Sleep(time.Second * 2)
139-
}
135+
run(length/uint64(workers), timeLine)
140136
}
141137
}

0 commit comments

Comments
 (0)