mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-05 15:02:26 +01:00
Merge pull request #203 from Fuzzlemann/master
PR for 3.6.0 (Fuzzlemann) (3)
This commit is contained in:
commit
b371f0fb1e
@ -42,10 +42,10 @@ public class PlanCommand extends TreeCommand<Plan> {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"/plan - Main Command",
|
||||
tCol+" Used to access all SubCommands & help",
|
||||
sCol+" /plan - List subcommands",
|
||||
sCol+" /plan <subcommand> ? - in depth help"
|
||||
mCol + "/plan - Main Command",
|
||||
tCol + " Used to access all SubCommands & help",
|
||||
sCol + " /plan - List subcommands",
|
||||
sCol + " /plan <subcommand> ? - in depth help"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,10 @@ public class AnalyzeCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Analysis Command",
|
||||
tCol+" Used to Refresh analysis cache & Access the result page",
|
||||
sCol+" /plan status can be used to check status of analysis while it is running.",
|
||||
sCol+" Aliases: analyze, analyse, analysis, a"
|
||||
mCol + "Analysis Command",
|
||||
tCol + " Used to Refresh analysis cache & Access the result page",
|
||||
sCol + " /plan status can be used to check status of analysis while it is running.",
|
||||
sCol + " Aliases: analyze, analyse, analysis, a"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,10 @@ public class InspectCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Inspect command",
|
||||
tCol+" Used to get a link to User's inspect page.",
|
||||
sCol+" Own inspect page can be accessed with /plan inspect",
|
||||
sCol+" Alias: /plan <name>"
|
||||
mCol + "Inspect command",
|
||||
tCol + " Used to get a link to User's inspect page.",
|
||||
sCol + " Own inspect page can be accessed with /plan inspect",
|
||||
sCol + " Alias: /plan <name>"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -47,10 +47,10 @@ public class ListCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"List command",
|
||||
tCol+" Used to get a link to players page.",
|
||||
sCol+" Players page contains links to all cached inspect pages.",
|
||||
sCol+" Alias: /plan pl"
|
||||
mCol + "List command",
|
||||
tCol + " Used to get a link to players page.",
|
||||
sCol + " Players page contains links to all cached inspect pages.",
|
||||
sCol + " Alias: /plan pl"
|
||||
};
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public class ListCommand extends SubCommand {
|
||||
|
||||
// Link
|
||||
String url = HtmlUtils.getServerAnalysisUrlWithProtocol().replace("server", "players");
|
||||
String message = Phrase.CMD_LINK + "";
|
||||
String message = Phrase.CMD_LINK.toString();
|
||||
boolean console = !CommandUtils.isPlayer(sender);
|
||||
if (console) {
|
||||
sender.sendMessage(message + url);
|
||||
@ -76,6 +76,6 @@ public class ListCommand extends SubCommand {
|
||||
sender.sendMessage(message);
|
||||
sender.sendLink(" ", Phrase.CMD_CLICK_ME.toString(), url);
|
||||
}
|
||||
sender.sendMessage(Phrase.CMD_FOOTER + "");
|
||||
sender.sendMessage(Phrase.CMD_FOOTER.toString());
|
||||
}
|
||||
}
|
||||
|
@ -39,11 +39,11 @@ public class ManageCommand extends TreeCommand<Plan> {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Manage command",
|
||||
tCol+" Used to Manage Database of the plugin.",
|
||||
sCol+" Alias: /plan m",
|
||||
sCol+" /plan m - List subcommands",
|
||||
sCol+" /plan m <subcommand> ? - in depth help"
|
||||
mCol + "Manage command",
|
||||
tCol + " Used to Manage Database of the plugin.",
|
||||
sCol + " Alias: /plan m",
|
||||
sCol + " /plan m - List subcommands",
|
||||
sCol + " /plan m <subcommand> ? - in depth help"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -51,10 +51,10 @@ public class QuickAnalyzeCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Quick Analysis command",
|
||||
tCol+" Used to get in game info about analysis.",
|
||||
sCol+" Has less info than full Analysis web page.",
|
||||
sCol+" Aliases: qanalyze, ganalyse, qanalysis, qa"
|
||||
mCol + "Quick Analysis command",
|
||||
tCol + " Used to get in game info about analysis.",
|
||||
sCol + " Has less info than full Analysis web page.",
|
||||
sCol + " Aliases: qanalyze, ganalyse, qanalysis, qa"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,10 @@ public class QuickInspectCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Quick Inspect command",
|
||||
tCol+" Used to get some inspect info in game.",
|
||||
sCol+" Has less info than full Inspect web page.",
|
||||
sCol+" Alias: /plan qi"
|
||||
mCol + "Quick Inspect command",
|
||||
tCol + " Used to get some inspect info in game.",
|
||||
sCol + " Has less info than full Inspect web page.",
|
||||
sCol + " Alias: /plan qi"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,10 @@ public class RegisterCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Web Register command",
|
||||
tCol+" Used to register a new user for the webserver.",
|
||||
sCol+" Registering a user for another player requires "+Permissions.MANAGE_WEB.getPerm()+" permission.",
|
||||
sCol+" Passwords are hashed with PBKDF2 (64,000 iterations of SHA1) using a cryptographically-random salt."
|
||||
mCol + "Web Register command",
|
||||
tCol + " Used to register a new user for the webserver.",
|
||||
sCol + " Registering a user for another player requires " + Permissions.MANAGE_WEB.getPerm() + " permission.",
|
||||
sCol + " Passwords are hashed with PBKDF2 (64,000 iterations of SHA1) using a cryptographically-random salt."
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,9 @@ public class SearchCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Search command",
|
||||
tCol+" Used to get a list of Player names that match the given argument.",
|
||||
sCol+" Example: /plan search 123 - Finds all users with 123 in their name."
|
||||
mCol + "Search command",
|
||||
tCol + " Used to get a list of Player names that match the given argument.",
|
||||
sCol + " Example: /plan search 123 - Finds all users with 123 in their name."
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -35,13 +35,13 @@ public class WebUserCommand extends TreeCommand<Plan> {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Web User Manage command",
|
||||
tCol+" Used to manage web users of the plugin",
|
||||
sCol+" Users have a permission level:",
|
||||
tCol+" 0 - Access to all pages",
|
||||
tCol+" 1 - Access to /players & all inspect pages",
|
||||
tCol+" 2 - Access to own inspect page",
|
||||
sCol+" Alias: /plan web"
|
||||
mCol + "Web User Manage command",
|
||||
tCol + " Used to manage web users of the plugin",
|
||||
sCol + " Users have a permission level:",
|
||||
tCol + " 0 - Access to all pages",
|
||||
tCol + " 1 - Access to /players & all inspect pages",
|
||||
tCol + " 2 - Access to own inspect page",
|
||||
sCol + " Alias: /plan web"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -47,10 +47,10 @@ public class ManageClearCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Manage Clear command",
|
||||
tCol+" Used to delete ALL data in the active database.",
|
||||
sCol+" Plugin should be reloaded after successful clear.",
|
||||
sCol+" Alias: /plan pl"
|
||||
mCol + "Manage Clear command",
|
||||
tCol + " Used to delete ALL data in the active database.",
|
||||
sCol + " Plugin should be reloaded after successful clear.",
|
||||
sCol + " Alias: /plan pl"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,9 @@ public class ManageHotswapCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Manage Hotswap command",
|
||||
tCol+" Used to change database in use on the fly.",
|
||||
sCol+" Does not change database if connection fails"
|
||||
mCol + "Manage Hotswap command",
|
||||
tCol + " Used to change database in use on the fly.",
|
||||
sCol + " Does not change database if connection fails"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ public class ManageImportCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Manage Import command",
|
||||
tCol+" Used to import data from other sources",
|
||||
sCol+" Analysis will be disabled during import.",
|
||||
sCol+" If a lot of users are not in the database, saving may take a long time."
|
||||
mCol + "Manage Import command",
|
||||
tCol + " Used to import data from other sources",
|
||||
sCol + " Analysis will be disabled during import.",
|
||||
sCol + " If a lot of users are not in the database, saving may take a long time."
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,8 @@ public class ManageRemoveCommand extends SubCommand {
|
||||
String tCol = colorScheme.getTertiaryColor();
|
||||
|
||||
String[] help = new String[]{
|
||||
mCol +"Manage Remove command",
|
||||
tCol+" Used to Remove user's data from the active database."
|
||||
mCol + "Manage Remove command",
|
||||
tCol + " Used to Remove user's data from the active database."
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -75,5 +75,4 @@ public class GeolocationPart extends RawData<GeolocationPart> {
|
||||
public void addGeoloc(String country) {
|
||||
geoLocations.computeIfPresent(country, (computedCountry, amount) -> amount + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package main.java.com.djrapitops.plan.data.analysis;
|
||||
import com.djrapitops.plugin.api.TimeAmount;
|
||||
import main.java.com.djrapitops.plan.data.TPS;
|
||||
import main.java.com.djrapitops.plan.ui.html.graphs.CPUGraphCreator;
|
||||
import main.java.com.djrapitops.plan.ui.html.graphs.RamGraphCreator;
|
||||
import main.java.com.djrapitops.plan.ui.html.graphs.TPSGraphCreator;
|
||||
import main.java.com.djrapitops.plan.utilities.FormatUtils;
|
||||
import main.java.com.djrapitops.plan.utilities.MiscUtils;
|
||||
@ -42,8 +43,8 @@ public class TPSPart extends RawData<TPSPart> {
|
||||
String tpsScatterWeek = TPSGraphCreator.buildScatterDataStringTPS(week, TimeAmount.WEEK.ms());
|
||||
String cpuScatterDay = CPUGraphCreator.buildScatterDataString(day, TimeAmount.DAY.ms());
|
||||
String cpuScatterWeek = CPUGraphCreator.buildScatterDataString(week, TimeAmount.WEEK.ms());
|
||||
String ramScatterDay = CPUGraphCreator.buildScatterDataString(day, TimeAmount.DAY.ms());
|
||||
String ramScatterWeek = CPUGraphCreator.buildScatterDataString(week, TimeAmount.WEEK.ms());
|
||||
String ramScatterDay = RamGraphCreator.buildScatterDataString(day, TimeAmount.DAY.ms());
|
||||
String ramScatterWeek = RamGraphCreator.buildScatterDataString(week, TimeAmount.WEEK.ms());
|
||||
|
||||
addValue("tpsscatterday", tpsScatterDay);
|
||||
addValue("tpsscatterweek", tpsScatterWeek);
|
||||
@ -55,7 +56,7 @@ public class TPSPart extends RawData<TPSPart> {
|
||||
addValue("ramscatterweek", ramScatterWeek);
|
||||
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
addValue("maxram", (runtime.maxMemory() / (1024L * 1024L)));
|
||||
addValue("maxram", runtime.maxMemory() / 1000000);
|
||||
|
||||
double averageTPSWeek = MathUtils.averageDouble(week.stream().map(TPS::getTps));
|
||||
double averageTPSDay = MathUtils.averageDouble(day.stream().map(TPS::getTps));
|
||||
|
@ -76,7 +76,7 @@ public class TPSCountTimer extends AbsRunnable {
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
|
||||
long totalMemory = runtime.totalMemory();
|
||||
long usedMemory = (totalMemory - runtime.freeMemory()) / (1024L * 1024L);
|
||||
long usedMemory = (totalMemory - runtime.freeMemory()) / 1000000;
|
||||
|
||||
int playersOnline = plugin.getServer().getOnlinePlayers().size();
|
||||
int loadedChunks = getLoadedChunks();
|
||||
@ -114,7 +114,7 @@ public class TPSCountTimer extends AbsRunnable {
|
||||
diff -= twentySeconds;
|
||||
}
|
||||
|
||||
double tpsN = twentySeconds / diff;
|
||||
double tpsN = MathUtils.round(twentySeconds / diff);
|
||||
|
||||
return new TPS(now, tpsN, playersOnline, cpuUsage, usedMemory, entityCount, chunksLoaded);
|
||||
}
|
||||
|
@ -179,6 +179,11 @@ public class MathUtils {
|
||||
* @return The rounded number
|
||||
*/
|
||||
public static double round(double number) {
|
||||
return Double.valueOf(decimalFormat.format(number));
|
||||
String formattedNumber = decimalFormat.format(number);
|
||||
if (formattedNumber.length() > 4) {
|
||||
formattedNumber = formattedNumber.substring(0, 3); //Fix for unknown reasons for not-rounding
|
||||
}
|
||||
|
||||
return Double.valueOf(formattedNumber);
|
||||
}
|
||||
}
|
||||
|
@ -1474,7 +1474,7 @@
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Memory Usage (Mt)'
|
||||
labelString: 'Memory Usage (MB)'
|
||||
}
|
||||
}],
|
||||
xAxes: [{
|
||||
@ -1573,7 +1573,7 @@
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Memory Usage (Mt)'
|
||||
labelString: 'Memory Usage (MB)'
|
||||
}
|
||||
}],
|
||||
xAxes: [{
|
||||
|
@ -154,5 +154,4 @@ public class MathUtilsTest {
|
||||
double result = MathUtils.sumDouble(l.stream());
|
||||
assertTrue(result + "/" + exp, exp == result);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user