From d550a191ce6992c6bc0c250f08bee3faeec8e113 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 12 Aug 2017 14:13:21 +0300 Subject: [PATCH] Remove useless debug messages --- .../plan/data/cache/DataCacheHandler.java | 4 ---- .../djrapitops/plan/data/cache/SessionCache.java | 10 ++-------- .../plan/data/cache/queue/DataCacheClearQueue.java | 2 -- .../plan/data/cache/queue/DataCacheGetQueue.java | 3 +-- .../plan/data/cache/queue/DataCacheSaveQueue.java | 5 ----- .../plan/data/listeners/PlanPlayerListener.java | 13 ------------- .../plan/database/tables/GMTimesTable.java | 6 ------ .../djrapitops/plan/database/tables/KillsTable.java | 2 -- .../plan/database/tables/SessionsTable.java | 3 --- .../djrapitops/plan/database/tables/TPSTable.java | 3 --- .../djrapitops/plan/database/tables/UsersTable.java | 3 --- .../plan/utilities/analysis/ExportUtility.java | 2 +- 12 files changed, 4 insertions(+), 52 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java index 11d2d8757..25fbb76e1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/DataCacheHandler.java @@ -175,7 +175,6 @@ public class DataCacheHandler extends SessionCache { * of DataCacheHandler after it has been fetched (if not already fetched) */ public void getUserDataForProcessing(DBCallableProcessor processor, UUID uuid, boolean cache) { - Log.debug(uuid + ": HANDLER getForProcess," + " Cache:" + cache); UserData uData = dataCache.get(uuid); if (uData == null) { if (cache) { @@ -241,7 +240,6 @@ public class DataCacheHandler extends SessionCache { if (i == null) { return; } - Log.debug(i.getUuid() + ": Adding to pool, type:" + i.getType().name()); processTask.addToPool(i); } @@ -407,9 +405,7 @@ public class DataCacheHandler extends SessionCache { * @param uuid Player's UUID */ public void clearFromCache(UUID uuid) { - Log.debug(uuid + ": Clear"); if (plugin.fetch().isOnline(uuid)) { - Log.debug(uuid + ": Online, did not clear"); UserData data = dataCache.get(uuid); if (data != null) { data.setClearAfterSave(false); diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/SessionCache.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/SessionCache.java index ea9c43ee7..d5a3244f4 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/SessionCache.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/SessionCache.java @@ -1,6 +1,5 @@ package main.java.com.djrapitops.plan.data.cache; -import main.java.com.djrapitops.plan.Log; import main.java.com.djrapitops.plan.data.SessionData; import main.java.com.djrapitops.plan.data.UserData; import main.java.com.djrapitops.plan.utilities.MiscUtils; @@ -32,9 +31,7 @@ public class SessionCache { * @param uuid UUID of the player. */ public void startSession(UUID uuid) { - long now = MiscUtils.getTime(); - Log.debug(uuid + ": Starting a session: " + now); - SessionData session = new SessionData(now); + SessionData session = new SessionData(MiscUtils.getTime()); activeSessions.put(uuid, session); } @@ -46,9 +43,7 @@ public class SessionCache { public void endSession(UUID uuid) { SessionData currentSession = activeSessions.get(uuid); if (currentSession != null) { - long now = MiscUtils.getTime(); - Log.debug(uuid + ": Ending a session: " + now); - currentSession.endSession(now); + currentSession.endSession(MiscUtils.getTime()); } } @@ -70,7 +65,6 @@ public class SessionCache { public void addSession(UserData data) { UUID uuid = data.getUuid(); SessionData currentSession = activeSessions.get(uuid); - Log.debug("Adding a session: " + uuid + " " + currentSession); if (currentSession != null && currentSession.isValid() && !data.getSessions().contains(currentSession)) { data.addSession(currentSession); activeSessions.remove(uuid); diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java index 6a2733742..9535946cf 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java @@ -38,7 +38,6 @@ public class DataCacheClearQueue extends Queue { * @param uuid UUID of the UserData object (Player's UUID) */ public void scheduleForClear(UUID uuid) { - Log.debug(uuid + ": Scheduling for clear"); queue.add(uuid); } @@ -52,7 +51,6 @@ public class DataCacheClearQueue extends Queue { return; } uuids = uuids.stream().filter(Objects::nonNull).collect(Collectors.toList()); - Log.debug("Scheduling for clear: " + uuids); try { queue.addAll(uuids); } catch (IllegalStateException e) { diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java index 7c311a3d9..4d4d35b4c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java @@ -40,7 +40,6 @@ public class DataCacheGetQueue extends Queue * fetch is complete, with the UserData object. */ public void scheduleForGet(UUID uuid, DBCallableProcessor... processors) { - Log.debug(uuid + ": Scheduling for get"); try { Map> map = new HashMap<>(); map.put(uuid, Arrays.asList(processors)); @@ -85,7 +84,7 @@ class GetConsumer extends Consumer>> { List processorsList = entrySet.getValue(); if (processorsList != null) { - Log.debug(uuid + ": Get, For:" + processorsList.size()); + Log.debug("Database", uuid + ": Get, For:" + processorsList.size()); try { db.giveUserDataToProcessors(uuid, processorsList); } catch (SQLException e) { diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java index f4386cc17..1f19ae89b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java @@ -14,7 +14,6 @@ import java.util.Collection; import java.util.UUID; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import java.util.stream.Collectors; /** * This Class is starts the Save Queue Thread, that saves data to the Database. @@ -42,7 +41,6 @@ public class DataCacheSaveQueue extends Queue { * @param data UserData object. */ public void scheduleForSave(UserData data) { - Log.debug(data.getUuid() + ": Scheduling for save"); try { queue.add(data); } catch (IllegalStateException e) { @@ -56,7 +54,6 @@ public class DataCacheSaveQueue extends Queue { * @param data Collection of UserData objects. */ public void scheduleForSave(Collection data) { - Log.debug("Scheduling for save: " + data.stream().map(UserData::getUuid).collect(Collectors.toList())); try { queue.addAll(data); } catch (IllegalStateException e) { @@ -113,11 +110,9 @@ class SaveConsumer extends Consumer { return; } - Log.debug(uuid + ": Saving: " + uuid); try { db.saveUserData(data); data.stopAccessing(); - Log.debug(uuid + ": Saved!"); if (data.shouldClearAfterSave()) { handler.getClearTask().scheduleForClear(uuid); } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java index 63ebebe1c..dc7b6ffc9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java @@ -4,7 +4,6 @@ import com.djrapitops.plugin.task.AbsRunnable; import com.djrapitops.plugin.utilities.player.Fetch; import com.djrapitops.plugin.utilities.player.Gamemode; import com.djrapitops.plugin.utilities.player.IPlayer; -import main.java.com.djrapitops.plan.Log; import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.data.UserData; import main.java.com.djrapitops.plan.data.cache.DataCacheHandler; @@ -65,8 +64,6 @@ public class PlanPlayerListener implements Listener { UUID uuid = player.getUniqueId(); handler.startSession(uuid); - Log.debug(uuid + ": PlayerJoinEvent"); - plugin.getRunnableFactory().createNew(new AbsRunnable("NewPlayerCheckTask") { @Override public void run() { @@ -87,13 +84,9 @@ public class PlanPlayerListener implements Listener { } else { handler.addToPool(loginInfo); } - - Log.debug(uuid + ": PlayerJoinEvent_AsyncTask_END, New:" + isNewPlayer); this.cancel(); } }).runTaskAsynchronously(); - - Log.debug(uuid + ": PlayerJoinEvent_END"); } /** @@ -109,7 +102,6 @@ public class PlanPlayerListener implements Listener { UUID uuid = player.getUniqueId(); handler.endSession(uuid); - Log.debug(uuid + ": PlayerQuitEvent"); long time = MiscUtils.getTime(); boolean banned = player.isBanned(); Gamemode gm = Gamemode.wrap(player.getGameMode()); @@ -117,8 +109,6 @@ public class PlanPlayerListener implements Listener { handler.addToPool(new LogoutInfo(uuid, time, banned, gm.name(), handler.getSession(uuid), worldName)); handler.saveCachedData(uuid); - - Log.debug(uuid + ": PlayerQuitEvent_END"); } /** @@ -138,7 +128,6 @@ public class PlanPlayerListener implements Listener { UUID uuid = player.getUniqueId(); handler.endSession(uuid); - Log.debug(uuid + ": PlayerKickEvent"); long time = MiscUtils.getTime(); boolean banned = player.isBanned(); @@ -148,7 +137,5 @@ public class PlanPlayerListener implements Listener { handler.addToPool(new LogoutInfo(uuid, time, banned, gm.name(), handler.getSession(uuid), worldName)); handler.addToPool(new KickInfo(uuid)); handler.saveCachedData(uuid); - - Log.debug(uuid + ": PlayerKickEvent_END"); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/GMTimesTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/GMTimesTable.java index 7a114e312..0951a739d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/GMTimesTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/GMTimesTable.java @@ -235,9 +235,6 @@ public class GMTimesTable extends Table { return; } - int batchSize = batch.size(); - Log.debug("Database", "Preparing update of GM Times - Batch Size: " + batchSize); - String[] gms = getGMKeyArray(); Set savedIDs = getSavedIDs(); @@ -305,9 +302,6 @@ public class GMTimesTable extends Table { return; } - int batchSize = batch.size(); - Log.debug("Database", "Preparing insertion of GM Times - Batch Size: " + batchSize); - String[] gms = getGMKeyArray(); PreparedStatement statement = null; diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/KillsTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/KillsTable.java index 7b7105a40..5ee4afe22 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/KillsTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/KillsTable.java @@ -82,7 +82,6 @@ public class KillsTable extends Table { * @throws SQLException */ public List getPlayerKills(int userId) throws SQLException { - Benchmark.start("Get Kills"); UsersTable usersTable = db.getUsersTable(); PreparedStatement statement = null; ResultSet set = null; @@ -100,7 +99,6 @@ public class KillsTable extends Table { } finally { close(set); close(statement); - Benchmark.stop("Database", "Get Kills"); } } diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java index 5d59fa9e1..216613c9c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/SessionsTable.java @@ -230,9 +230,6 @@ public class SessionsTable extends Table { return; } - int batchSize = batch.size(); - Log.debug("Database", "Preparing insertion of sessions - Batch Size: " + batchSize); - PreparedStatement statement = null; try { statement = prepareStatement("INSERT INTO " + tableName + " (" diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java index fccb2adec..997d6fdb6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java @@ -135,9 +135,6 @@ public class TPSTable extends Table { return; } - int batchSize = batch.size(); - Log.debug("Database", "Preparing insertion of TPS - Batch Size: " + batchSize); - PreparedStatement statement = null; try { statement = prepareStatement("INSERT INTO " + tableName + " (" diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/UsersTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/UsersTable.java index 8bd6da8dd..39ba5d848 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/UsersTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/UsersTable.java @@ -691,9 +691,6 @@ public class UsersTable extends Table { return; } - int batchSize = data.size(); - Log.debug("Database", "Preparing insertion of new users - Batch Size: " + batchSize); - PreparedStatement statement = null; try { statement = prepareStatement(getInsertStatement()); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/ExportUtility.java b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/ExportUtility.java index d2aee8737..e03c38f4a 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/ExportUtility.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/analysis/ExportUtility.java @@ -78,7 +78,7 @@ public class ExportUtility { Benchmark.start("Exporting Player pages"); rawData.forEach(userData -> writeInspectHtml(userData, playersFolder, playerHtml)); - Benchmark.stop("Exporting Player pages"); + Benchmark.stop("Export", "Exporting Player pages"); } catch (IOException ex) { Log.toLog("ExportUtils.export", ex); } finally {