mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 11:08:08 +01:00
Improved player retention calculation for recent registers #577
This commit is contained in:
parent
dffd759c05
commit
18e860046a
@ -229,10 +229,18 @@ public class AnalysisData extends RawData {
|
||||
long twoWeeksAgo = now - TimeAmount.WEEK.ms() * 2L;
|
||||
|
||||
List<PlayerProfile> playersStuckPerMonth = newMonth.stream()
|
||||
.filter(p -> p.playedBetween(monthAgo, twoWeeksAgo) && p.playedBetween(twoWeeksAgo, now))
|
||||
.filter(p -> {
|
||||
long backLimit = Math.max(monthAgo, p.getRegistered());
|
||||
long half = backLimit / 2L;
|
||||
return p.playedBetween(backLimit, half) && p.playedBetween(half, now);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
List<PlayerProfile> playersStuckPerWeek = newWeek.stream()
|
||||
.filter(p -> p.playedBetween(weekAgo, fourDaysAgo) && p.playedBetween(fourDaysAgo, now))
|
||||
.filter(p -> {
|
||||
long backLimit = Math.max(weekAgo, p.getRegistered());
|
||||
long half = backLimit / 2L;
|
||||
return p.playedBetween(backLimit, half) && p.playedBetween(half, now);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int stuckPerM = playersStuckPerMonth.size();
|
||||
|
Loading…
Reference in New Issue
Block a user