From 860241572c61e4feb0c66b2838adcb69ddc20450 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Mon, 20 Jan 2025 13:47:16 -0500 Subject: [PATCH] added round counting for when -l (loop) is enabled to track how many completions are processed --- ptrstream.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ptrstream.go b/ptrstream.go index 8ef6497..16811f1 100644 --- a/ptrstream.go +++ b/ptrstream.go @@ -47,6 +47,7 @@ type Stats struct { cnames uint64 speedHistory []float64 mu sync.Mutex + round uint64 } func (s *Stats) increment() { @@ -632,8 +633,9 @@ func main() { } // First line: stats - statsLine := fmt.Sprintf(" [aqua]Elapsed:[:-] [white]%s [gray]│[-] [aqua]Count:[:-] [white]%s [gray]│[-] [aqua]Progress:[:-] [darkgray]%.2f%%[-] [gray]│[-] [aqua]Rate:[:-] %s [gray]│[-] [aqua]CNAMEs:[:-] [yellow]%s[-][darkgray] (%.1f%%)[-] [gray]│[-] [aqua]Successful:[:-] [green]✓ %s[-][darkgray] (%.1f%%)[-] [gray]│[-] [aqua]Failed:[:-] [red]✗ %s[-][darkgray] (%.1f%%)[-]\n", + statsLine := fmt.Sprintf(" [aqua]Elapsed:[:-] [white]%s [gray]│[-] [aqua]Round:[:-] [white]%d [gray]│[-] [aqua]Count:[:-] [white]%s [gray]│[-] [aqua]Progress:[:-] [darkgray]%.2f%%[-] [gray]│[-] [aqua]Rate:[:-] %s [gray]│[-] [aqua]CNAMEs:[:-] [yellow]%s[-][darkgray] (%.1f%%)[-] [gray]│[-] [aqua]Successful:[:-] [green]✓ %s[-][darkgray] (%.1f%%)[-] [gray]│[-] [aqua]Failed:[:-] [red]✗ %s[-][darkgray] (%.1f%%)[-]\n", formatDuration(time.Since(stats.startTime)), + atomic.LoadUint64(&stats.round)+1, formatNumber(processed), percent, colorizeSpeed(avgSpeed),