From c77e526759a74e8ff5f5c634dfeb68dc8c4a688c Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Wed, 24 Apr 2024 14:59:28 +0100 Subject: [PATCH] Allow write throttle to be changed at runtime Also added some help in the bottom area for the time being --- hammer/hammer.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hammer/hammer.go b/hammer/hammer.go index be85854..a135124 100644 --- a/hammer/hammer.go +++ b/hammer/hammer.go @@ -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() { @@ -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 })