summaryrefslogtreecommitdiff
path: root/src/main/java/com/it_jaros/jscanner/ProgressBar.java
diff options
context:
space:
mode:
authorGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-07-07 23:49:43 +0200
committerGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-07-09 09:59:29 +0200
commit36960d3aecd84f1f99dcd4efb29bba2d5003c369 (patch)
tree061c7fae369dd2e92aac8d97221ea824bcc8a5f9 /src/main/java/com/it_jaros/jscanner/ProgressBar.java
parent192160541bb31c74468509faf5b19f42b0e4d450 (diff)
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
Diffstat (limited to 'src/main/java/com/it_jaros/jscanner/ProgressBar.java')
-rw-r--r--src/main/java/com/it_jaros/jscanner/ProgressBar.java12
1 files changed, 6 insertions, 6 deletions
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(),