diff --git a/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/PingMutator.java b/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/PingMutator.java index 33caa7855..855c68ee5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/PingMutator.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/store/mutators/PingMutator.java @@ -26,7 +26,7 @@ public class PingMutator { public PingMutator filterBy(Predicate predicate) { return new PingMutator(pings.stream().filter(predicate).collect(Collectors.toList())); } - + public PingMutator filterByServer(UUID serverUUID) { return filterBy(ping -> serverUUID.equals(ping.getServerUUID())); } @@ -52,6 +52,9 @@ public class PingMutator { int max = -1; for (Ping ping : pings) { Integer value = ping.getMax(); + if (value < 0) { + continue; + } if (value > max) { max = value; } @@ -64,6 +67,9 @@ public class PingMutator { int min = -1; for (Ping ping : pings) { Integer value = ping.getMin(); + if (value < 0) { + continue; + } if (value < min || min == -1) { min = value; } @@ -73,6 +79,8 @@ public class PingMutator { } public double average() { - return pings.stream().mapToDouble(Ping::getAverage).average().orElse(-1); + return pings.stream().mapToDouble(Ping::getAverage) + .filter(value -> value >= 0) + .average().orElse(-1); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/PingTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/PingTable.java index 30edb784f..2d9d47d42 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/PingTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/PingTable.java @@ -56,7 +56,8 @@ public class PingTable extends UserIDTable { public void clean() { String sql = "DELETE FROM " + tableName + - " WHERE (" + Col.DATE + " i != -1) + .filter(i -> i >= 0) .max(); if (!max.isPresent()) { @@ -46,12 +46,12 @@ public class PingInsertProcessor implements CriticalRunnable { int minValue = history.stream() .mapToInt(DateObj::getValue) - .filter(i -> i != -1) + .filter(i -> i >= 0) .min().orElse(-1); double avgValue = history.stream() .mapToInt(DateObj::getValue) - .filter(i -> i != -1) + .filter(i -> i >= 0) .average().orElse(-1); int maxValue = max.getAsInt(); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/tasks/server/PingCountTimer.java b/Plan/src/main/java/com/djrapitops/plan/system/tasks/server/PingCountTimer.java index 4edba4600..ef2c8ae3a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/tasks/server/PingCountTimer.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/tasks/server/PingCountTimer.java @@ -155,7 +155,7 @@ public class PingCountTimer extends AbsRunnable implements Listener { addPlayer(player); } } - }).runTaskLater(PING_INTERVAL); + }).runTaskLater(PING_INTERVAL * 2); } @EventHandler diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PingTable.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PingTable.java index 3c904c173..7478d5fcc 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PingTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/tables/PingTable.java @@ -14,8 +14,8 @@ public class PingTable extends TableContainer { super( Icon.called("globe") + " Country", Icon.called("signal") + " Average Ping", - Icon.called("signal") + " Maximum Ping", - Icon.called("signal") + " Minimum Ping" + Icon.called("signal") + " Worst Ping", + Icon.called("signal") + " Best Ping" ); setColor("amber"); diff --git a/Plan/src/main/resources/web/server.html b/Plan/src/main/resources/web/server.html index 9e84f2528..cdef56edf 100644 --- a/Plan/src/main/resources/web/server.html +++ b/Plan/src/main/resources/web/server.html @@ -1064,7 +1064,27 @@
- ${tablePing} +
+
+
+
+

Connection Information

+
+ +
+
+
+ ${tablePing} +
+
@@ -1436,7 +1456,7 @@ healthGauge('healthGauge', [v.data.healthIndex]); onlineActivityCalendar('#calendar', v.data.calendar, v.values.firstDay); horizontalBarChart('countryBarChart', v.data.countryCategories, [series.country], 'Players'); - lineChart('pingGraph', [series.playersOnline, series.avgPing, series.maxPing, series.minPing]); + lineChart('pingGraph', [series.avgPing, series.maxPing, series.minPing]); ${sessionTabGraphViewFunctions} /**/