From 19458e8459534d7641280b1a8df9f5b3a118d424 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 26 Sep 2024 18:01:18 +0100 Subject: [PATCH] accounting: write the current bwlimit to the log on SIGUSR2 --- fs/accounting/accounting_unix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/accounting/accounting_unix.go b/fs/accounting/accounting_unix.go index 76c0a3509..bacb0498a 100644 --- a/fs/accounting/accounting_unix.go +++ b/fs/accounting/accounting_unix.go @@ -35,12 +35,13 @@ func (tb *tokenBucket) startSignalHandler() { tb.toggledOff = !tb.toggledOff tb.curr, tb.prev = tb.prev, tb.curr - s := "disabled" + s, limit := "disabled", "off" if !tb.curr._isOff() { s = "enabled" + limit = tb.currLimit.Bandwidth.String() } - fs.Logf(nil, "Bandwidth limit %s by user", s) + fs.Logf(nil, "Bandwidth limit %s by user (now %s)", s, limit) }() } }()