public class AnalysisUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getAverage(AnalysisType analysisType,
PluginData source,
Collection<UUID> uuids) |
static String |
getBooleanPercentage(AnalysisType analysisType,
PluginData source,
Collection<UUID> uuids) |
static String |
getBooleanTotal(AnalysisType analysisType,
PluginData source,
Collection<UUID> uuids) |
static List<int[]> |
getDaysAndHours(List<Long> sessionStarts)
Transforms the session start list into a list of int arrays.
|
static long |
getLastSeen(List<Session> userSessions) |
static long |
getLongestSessionLength(List<Session> sessions) |
static long |
getNewPlayers(List<Long> registered,
long scale,
long now) |
static long |
getNewUsersPerDay(List<Long> registers,
long scale) |
static String |
getTotal(AnalysisType analysisType,
PluginData source,
Collection<UUID> uuids) |
static long |
getTotalPlaytime(List<Session> sessions) |
static int |
getUniqueJoins(Map<UUID,List<Session>> sessions,
long scale)
Used to calculate unique players that have played within the time frame determined by scale.
|
static int |
getUniqueJoinsPerDay(Map<UUID,List<Session>> sessions,
long scale) |
static boolean |
isActive(long now,
long lastPlayed,
long playTime,
int loginTimes) |
static List<Long> |
transformSessionDataToLengths(Collection<Session> data) |
public static boolean isActive(long now, long lastPlayed, long playTime, int loginTimes)
public static List<Long> transformSessionDataToLengths(Collection<Session> data)
public static String getTotal(AnalysisType analysisType, PluginData source, Collection<UUID> uuids)
public static String getAverage(AnalysisType analysisType, PluginData source, Collection<UUID> uuids)
public static String getBooleanPercentage(AnalysisType analysisType, PluginData source, Collection<UUID> uuids)
public static String getBooleanTotal(AnalysisType analysisType, PluginData source, Collection<UUID> uuids)
public static int getUniqueJoins(Map<UUID,List<Session>> sessions, long scale)
sessions
- All sessions sorted in a map by User's UUIDscale
- Scale (milliseconds), time before (Current epoch - scale) will be ignored.public static int getUniqueJoinsPerDay(Map<UUID,List<Session>> sessions, long scale)
public static List<int[]> getDaysAndHours(List<Long> sessionStarts)
First number signifies the Day of Week. (0 = Monday, 6 = Sunday) Second number signifies the Hour of Day. (0 = 0 AM, 23 = 11 PM)
sessionStarts
- List of Session start Epoch ms.Copyright © 2017. All rights reserved.