Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow write throttle to be changed at runtime #125

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hammer/hammer.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ func hostUI(ctx context.Context, hammer *Hammer) {
}
klog.SetOutput(logView)

helpView := tview.NewTextView()
helpView.SetText("+/- to increase/decrease read load\n>/< to increase/decrease write load")
grid.AddItem(helpView, 2, 0, 1, 1, 0, 0, false)

app := tview.NewApplication()
ticker := time.NewTicker(1 * time.Second)
go func() {
Expand All @@ -300,6 +304,12 @@ func hostUI(ctx context.Context, hammer *Hammer) {
case '-':
klog.Info("Decreasing the read operations per second")
hammer.readThrottle.Decrease()
case '>':
klog.Info("Increasing the write operations per second")
hammer.writeThrottle.Increase()
case '<':
klog.Info("Decreasing the write operations per second")
hammer.writeThrottle.Decrease()
}
return event
})
Expand Down
Loading