mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-24 18:17:53 +01:00
Filtered out ping under 0 and over 4000ms, increased ping data gather delay to 15s #684
This commit is contained in:
parent
12073e9732
commit
23929d73ca
@ -52,7 +52,7 @@ public class PingMutator {
|
||||
int max = -1;
|
||||
for (Ping ping : pings) {
|
||||
Integer value = ping.getMax();
|
||||
if (value < 0 || 8000 < value) {
|
||||
if (value <= 0 || 4000 < value) {
|
||||
continue;
|
||||
}
|
||||
if (value > max) {
|
||||
@ -67,7 +67,7 @@ public class PingMutator {
|
||||
int min = -1;
|
||||
for (Ping ping : pings) {
|
||||
Integer value = ping.getMin();
|
||||
if (value < 0 || 8000 < value) {
|
||||
if (value <= 0 || 4000 < value) {
|
||||
continue;
|
||||
}
|
||||
if (value < min || min == -1) {
|
||||
@ -80,7 +80,7 @@ public class PingMutator {
|
||||
|
||||
public double average() {
|
||||
return pings.stream().mapToDouble(Ping::getAverage)
|
||||
.filter(value -> value >= 0 && value <= 8000)
|
||||
.filter(value -> value > 0 && value <= 4000)
|
||||
.average().orElse(-1);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class PingInsertProcessor implements CriticalRunnable {
|
||||
long lastDate = history.get(history.size() - 1).getDate();
|
||||
OptionalInt max = history.stream()
|
||||
.mapToInt(DateObj::getValue)
|
||||
.filter(i -> i >= 0)
|
||||
.filter(i -> i > 0 && i < 4000)
|
||||
.max();
|
||||
|
||||
if (!max.isPresent()) {
|
||||
@ -46,12 +46,12 @@ public class PingInsertProcessor implements CriticalRunnable {
|
||||
|
||||
int minValue = history.stream()
|
||||
.mapToInt(DateObj::getValue)
|
||||
.filter(i -> i >= 0)
|
||||
.filter(i -> i > 0 && i < 4000)
|
||||
.min().orElse(-1);
|
||||
|
||||
double avgValue = history.stream()
|
||||
.mapToInt(DateObj::getValue)
|
||||
.filter(i -> i >= 0)
|
||||
.filter(i -> i > 0 && i < 4000)
|
||||
.average().orElse(-1);
|
||||
|
||||
int maxValue = max.getAsInt();
|
||||
|
@ -160,7 +160,7 @@ public class PingCountTimer extends AbsRunnable implements Listener {
|
||||
addPlayer(player);
|
||||
}
|
||||
}
|
||||
}).runTaskLater(TimeAmount.SECOND.ticks() * 10L);
|
||||
}).runTaskLater(TimeAmount.SECOND.ticks() * 15L);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user