From 36960d3aecd84f1f99dcd4efb29bba2d5003c369 Mon Sep 17 00:00:00 2001 From: Matthias Jaros Date: Tue, 7 Jul 2026 23:49:43 +0200 Subject: Moved host counters into one place to have them together and actually changed meaning of host total counter to what it actually is. a total counter and not a done hosts counter --- src/main/java/com/it_jaros/jscanner/ProgressBar.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/it_jaros/jscanner/ProgressBar.java') diff --git a/src/main/java/com/it_jaros/jscanner/ProgressBar.java b/src/main/java/com/it_jaros/jscanner/ProgressBar.java index 7682e71..6c3c30d 100644 --- a/src/main/java/com/it_jaros/jscanner/ProgressBar.java +++ b/src/main/java/com/it_jaros/jscanner/ProgressBar.java @@ -155,15 +155,15 @@ public class ProgressBar { Counter hostCounter, Counter hostTotalCounter, Counter socketCounter, Counter threadCounter) { - int doneHosts = hostTotalCounter.current(); - int runningHosts = hostCounter.current(); - int total = doneHosts + runningHosts; - long percent = total == 0 ? 100 : doneHosts * 100L / total; + int total = hostTotalCounter.current(); + int running = hostCounter.current(); + int done = total - running; + long percent = total == 0 ? 100 : done * 100L / total; String line = String.format( "hosts: %d running, %d done | sockets: %d active, %d peak | workers: %d active, %d peak", - runningHosts, - doneHosts, + running, + done, socketCounter.current(), socketCounter.max(), threadCounter.current(), -- cgit v1.3.1