summaryrefslogtreecommitdiff
path: root/lib/textui/log_memstats.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-12-29 23:53:55 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-05 19:48:17 -0700
commit6ce1332d3cac5b74d2f049861f04cc2fa282d747 (patch)
tree198b1688b1329ee042175fd369b30b953f15accb /lib/textui/log_memstats.go
parent8efc82d0b1a167830970135c78d173667080b116 (diff)
cmd/btrfs-rec inspect rebuild-nodes: Optimize memory use
Diffstat (limited to 'lib/textui/log_memstats.go')
-rw-r--r--lib/textui/log_memstats.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/textui/log_memstats.go b/lib/textui/log_memstats.go
index 6e3c3a1..7ef35da 100644
--- a/lib/textui/log_memstats.go
+++ b/lib/textui/log_memstats.go
@@ -19,14 +19,14 @@ type LiveMemUse struct {
var _ fmt.Stringer = (*LiveMemUse)(nil)
-var liveMemUseUpdateInterval = Tunable(1 * time.Second)
+var LiveMemUseUpdateInterval = Tunable(1 * time.Second)
func (o *LiveMemUse) String() string {
o.mu.Lock()
// runtime.ReadMemStats() calls stopTheWorld(), so we want to
// rate-limit how often we call it.
- if now := time.Now(); now.Sub(o.last) > liveMemUseUpdateInterval {
+ if now := time.Now(); now.Sub(o.last) > LiveMemUseUpdateInterval {
runtime.ReadMemStats(&o.stats)
o.last = now
}