= Updated DB info

This commit is contained in:
Matthew Cech
2019-05-24 00:39:07 -07:00
parent 434ff1b46b
commit 634d67917f
8 changed files with 71 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandCrouton extends Command
public class CommandCrouton extends Command
{
public CommandCrouton(KittyRole level, KittyRating rating) { super(level, rating); }
+1 -1
View File
@@ -28,7 +28,7 @@ public class CommandDBFlush extends Command
KittyEmbed embed = new KittyEmbed();
embed.title = "Database queue flushed";
embed.descriptionText = "flushed: " + numUpdated;
embed.descriptionText = "**Dirty:** " + numUpdated;
embed.color = new Color(7*16, 8*16, 9*16);
res.CallEmbed(embed);
+43
View File
@@ -0,0 +1,43 @@
package commands;
import java.awt.Color;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import core.Command;
import core.DatabaseManager;
import core.LocStrings;
import dataStructures.KittyChannel;
import dataStructures.KittyEmbed;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
import dataStructures.KittyRole;
import dataStructures.KittyUser;
import dataStructures.Response;
import dataStructures.UserInput;
public class CommandDBStats extends Command
{
DateFormat dateFormat;
public CommandDBStats(KittyRole level, KittyRating rating)
{
super(level, rating);
dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
}
@Override
public String HelpText() { return LocStrings.Stub("DBStatsInfo"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
KittyEmbed embed = new KittyEmbed();
embed.title = "Database Info";
embed.descriptionText = "**Tracked Items:** " + DatabaseManager.instance.GetTrackedObjectsSize();
embed.descriptionText += "\n";
embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.GetLastUpkeep()) + " UTC-7";
embed.color = new Color(7*16, 8*16, 9*16);
res.CallEmbed(embed);
}
}