mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 12:07:35 +01:00
Adds more visibility to the code
This commit is contained in:
parent
36574ec4e2
commit
f7941fd59f
@ -162,7 +162,10 @@ public class AnalysisUtils {
|
||||
* @return
|
||||
*/
|
||||
public static String getBooleanPercentage(AnalysisType analysisType, PluginData source, List<UUID> uuids) {
|
||||
if (analysisType == AnalysisType.BOOLEAN_PERCENTAGE) {
|
||||
if (analysisType != AnalysisType.BOOLEAN_PERCENTAGE) {
|
||||
return source.parseContainer("Err ", "Wrong Analysistype specified: " + analysisType.name());
|
||||
}
|
||||
|
||||
try {
|
||||
List<Boolean> tempList = getCorrectValues(uuids, source)
|
||||
.map(value -> (boolean) value)
|
||||
@ -173,8 +176,6 @@ public class AnalysisUtils {
|
||||
return logPluginDataCausedError(source, e);
|
||||
}
|
||||
}
|
||||
return source.parseContainer("Err ", "Wrong Analysistype specified: " + analysisType.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param analysisType
|
||||
@ -183,7 +184,10 @@ public class AnalysisUtils {
|
||||
* @return
|
||||
*/
|
||||
public static String getBooleanTotal(AnalysisType analysisType, PluginData source, List<UUID> uuids) {
|
||||
if (analysisType == AnalysisType.BOOLEAN_TOTAL) {
|
||||
if (analysisType != AnalysisType.BOOLEAN_TOTAL) {
|
||||
return source.parseContainer("Err ", "Wrong Analysistype specified: " + analysisType.name());
|
||||
}
|
||||
|
||||
try {
|
||||
List<Boolean> tempList = getCorrectValues(uuids, source)
|
||||
.map(value -> (boolean) value)
|
||||
@ -194,8 +198,6 @@ public class AnalysisUtils {
|
||||
return logPluginDataCausedError(source, e);
|
||||
}
|
||||
}
|
||||
return source.parseContainer("Err ", "Wrong Analysistype specified: " + analysisType.name());
|
||||
}
|
||||
|
||||
private static String logPluginDataCausedError(PluginData source, Throwable e) {
|
||||
Log.error("A PluginData-source caused an exception: " + source.getPlaceholder("").replace("%", ""));
|
||||
@ -214,6 +216,7 @@ public class AnalysisUtils {
|
||||
public static int getUniqueJoins(Map<UUID, List<SessionData>> sessions, long scale) {
|
||||
long now = MiscUtils.getTime();
|
||||
long nowMinusScale = now - scale;
|
||||
|
||||
Set<UUID> uniqueJoins = new HashSet<>();
|
||||
sessions.forEach((uuid, s) ->
|
||||
s.stream()
|
||||
@ -221,6 +224,7 @@ public class AnalysisUtils {
|
||||
.map(session -> uuid)
|
||||
.forEach(uniqueJoins::add)
|
||||
);
|
||||
|
||||
return uniqueJoins.size();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user