= Core subsystem formatting update

This commit is contained in:
Matthew Cech
2019-06-19 21:48:37 -07:00
parent ba843ca645
commit feca9e542a
21 changed files with 230 additions and 229 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ public class CommandChangeIndicator extends Command
String indicator = arg.substring(0, 1);
if(indicator.charAt(0) == '\n' || indicator.charAt(0) == '\t' || indicator.charAt(0) == '\r')
{
res.send(LocStrings.Lookup("ChangeIndicatorError"));
res.send(LocStrings.lookup("ChangeIndicatorError"));
return;
}
+1 -1
View File
@@ -21,7 +21,7 @@ public class CommandChoose extends Command
{
if(input.args.trim().length() == 0)
{
res.send(Stats.instance.GetHelpText(input.key));
res.send(Stats.instance.getHelpText(input.key));
return;
}
+1 -1
View File
@@ -20,7 +20,7 @@ public class CommandHelp extends Command
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String help = Stats.instance.GetHelpText(input.args);
String help = Stats.instance.getHelpText(input.args);
if(help == null)
{
+3 -3
View File
@@ -39,11 +39,11 @@ public class CommandHelpBuilder extends Command {
commandsByRole.put(KittyRole.values()[i], new ArrayList<Command>());
// Sort commands out
ArrayList<Command> commands = Stats.instance.GetAllCommands();
ArrayList<Command> commands = Stats.instance.getAllCommands();
for(int i = 0; i < commands.size(); ++i)
{
Command current = commands.get(i);
commandsByRole.get(current.RequiredRole()).add(current);
commandsByRole.get(current.requiredRole()).add(current);
}
// Format outstring and send it back for now
@@ -112,7 +112,7 @@ public class CommandHelpBuilder extends Command {
commandsSoFar.add(command);
// Write out all the keys and the help text
ArrayList<String> keys = command.RegisteredNames();
ArrayList<String> keys = command.registeredNames();
for(int j = 0; j < keys.size(); ++j)
{
if(j != 0)
+3 -3
View File
@@ -27,7 +27,7 @@ public class CommandShutdown extends Command
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
// Flag the shutdown immediately.
Stats.instance.IndicateShutdown();
Stats.instance.indicateShutdown();
boolean isSafe = false;
switch(input.args.toLowerCase().trim())
@@ -48,14 +48,14 @@ public class CommandShutdown extends Command
// Force upkeep, this works so long as upkeep is on the main thread.
res.sendImmediate(LocStrings.stub("ShutdownSafe"));
DatabaseManager.instance.upkeep();
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
GlobalLog.Warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
System.exit(0);
}
else
{
res.sendImmediate(LocStrings.stub("ShutdownUnsafe"));// "``");
GlobalLog.Warn(LogFilter.Command, LocStrings.Lookup("ShutdownSafe"));
GlobalLog.Warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
System.exit(0);
}
}
+8 -8
View File
@@ -28,8 +28,8 @@ public class CommandStats extends Command
// Variables
Stats stats = Stats.instance;
String out = "";
long seen = stats.GetMessagesSeen();
long processed = stats.GetCommandsProcessed();
long seen = stats.getMessagesSeen();
long processed = stats.getCommandsProcessed();
// General
out += "General";
@@ -37,20 +37,20 @@ public class CommandStats extends Command
out += " Messages observed: " + seen + "\n";
out += "Commands processed: " + processed + "\n";
out += " Command invoke %: " + ((int)((processed / (float)seen) * 1000)) / 10.0f + "%\n";
out += " Bot uptime: " + stats.GetFormattedUptime() + "\n";
out += " Bot uptime: " + stats.getFormattedUptime() + "\n";
out += "```\n";
// Health
out += "Health";
out += "```\n";
out += " SMT cores: " + stats.GetCPUAvailable() + "\n";
out += " SMT cores: " + stats.getCPUAvailable() + "\n";
// If CPU load works on this OS, list it. -1.0 is the error state
double CPULoad = stats.GetSystemCPULoad();
double CPULoad = stats.getSystemCPULoad();
out += CPULoad > -0.9
? " CPU Load: " + (CPULoad * 100) + "%\n" : "";
ThreadData data = stats.GetThreadData();
ThreadData data = stats.getThreadData();
Integer terminated = data.states.get(Thread.State.TERMINATED);
Integer runnable = data.states.get(Thread.State.RUNNABLE);
Integer blocked = data.states.get(Thread.State.BLOCKED);
@@ -69,8 +69,8 @@ public class CommandStats extends Command
// Cache
Integer guildCount = stats.GetGuildCount();
Integer userCount = stats.GetUserCount();
Integer guildCount = stats.getGuildCount();
Integer userCount = stats.getUserCount();
out += "Cache";
out += "```\n"