mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 03:57:33 +01:00
Remove some Useless debug information
This commit is contained in:
parent
9e78f62267
commit
0a74e37122
@ -1,9 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../Abstract-Plugin-Framework/AbstractPluginFramework/target/AbstractPluginFramework.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../Abstract-Plugin-Framework/AbstractPluginFramework/target/AbstractPluginFramework.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.3/abstract-plugin-framework-2.0.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.3/abstract-plugin-framework-2.0.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -145,7 +145,7 @@ public class DataCacheHandler extends SessionCache {
|
||||
}
|
||||
try {
|
||||
periodicTaskIsSaving = true;
|
||||
Log.debug("Database", "Periodic Cache Save");
|
||||
Log.debug("Database", "Periodic Cache Save: " + dataCache.size());
|
||||
handler.saveHandlerDataToCache();
|
||||
handler.saveCachedUserData();
|
||||
if (timesSaved % clearAfterXsaves == 0) {
|
||||
@ -342,7 +342,7 @@ public class DataCacheHandler extends SessionCache {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Log.debug("Database", "Periodic TPS Save");
|
||||
Log.debug("Database", "Periodic TPS Save: " + averages.size());
|
||||
db.getTpsTable().saveTPSData(averages);
|
||||
} catch (SQLException ex) {
|
||||
Log.toLog(this.getClass().getName(), ex);
|
||||
|
@ -537,10 +537,8 @@ public abstract class SQLDB extends Database {
|
||||
if (uuid == null) {
|
||||
return;
|
||||
}
|
||||
setStatus("Save userdata: " + uuid);
|
||||
Log.debug("Database", "Save userdata: " + uuid);
|
||||
checkConnection();
|
||||
Log.debug("Database", "DB_Save:");
|
||||
Log.debug("Database", data.toString());
|
||||
data.access();
|
||||
usersTable.saveUserDataInformation(data);
|
||||
int userId = usersTable.getUserId(uuid.toString());
|
||||
|
@ -6,7 +6,6 @@ import main.java.com.djrapitops.plan.data.time.GMTimes;
|
||||
import main.java.com.djrapitops.plan.database.Container;
|
||||
import main.java.com.djrapitops.plan.database.DBUtils;
|
||||
import main.java.com.djrapitops.plan.database.databases.SQLDB;
|
||||
import main.java.com.djrapitops.plan.utilities.Benchmark;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
@ -201,8 +200,6 @@ public class GMTimesTable extends Table {
|
||||
return;
|
||||
}
|
||||
|
||||
Benchmark.start("Save GMTimes");
|
||||
|
||||
Set<Integer> savedIDs = getSavedIDs();
|
||||
|
||||
Map<Integer, GMTimes> gmTimes = new HashMap<>();
|
||||
@ -231,7 +228,6 @@ public class GMTimesTable extends Table {
|
||||
gamemodeTimes.keySet().removeAll(savedIDs);
|
||||
|
||||
addNewGMTimesRows(gamemodeTimes);
|
||||
Benchmark.stop("Database", "Save GMTimes");
|
||||
}
|
||||
|
||||
private void saveGMTimesBatch(List<Container<GMTimes>> batch) throws SQLException {
|
||||
@ -274,7 +270,6 @@ public class GMTimesTable extends Table {
|
||||
statement.addBatch();
|
||||
}
|
||||
|
||||
Log.debug("Database", "Executing GM Times batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
} finally {
|
||||
close(statement);
|
||||
@ -286,8 +281,6 @@ public class GMTimesTable extends Table {
|
||||
return;
|
||||
}
|
||||
|
||||
Benchmark.start("Add GMTimes Rows");
|
||||
|
||||
Map<Integer, GMTimes> gmTimes = new HashMap<>();
|
||||
|
||||
for (Map.Entry<Integer, Map<String, Long>> entrySet : gamemodeTimes.entrySet()) {
|
||||
@ -305,8 +298,6 @@ public class GMTimesTable extends Table {
|
||||
Log.toLog("GMTimesTable.addNewGMTimesRows", e);
|
||||
}
|
||||
});
|
||||
|
||||
Benchmark.stop("Database", "Add GMTimes Rows");
|
||||
}
|
||||
|
||||
private void addNewGMTimesBatch(List<Container<GMTimes>> batch) throws SQLException {
|
||||
@ -343,7 +334,6 @@ public class GMTimesTable extends Table {
|
||||
statement.addBatch();
|
||||
}
|
||||
|
||||
Log.debug("Database", "Executing GM Times batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
} finally {
|
||||
close(statement);
|
||||
|
@ -74,7 +74,6 @@ public class IPsTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<InetAddress> getIPAddresses(int userId) throws SQLException {
|
||||
Benchmark.start("Get Ips");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -95,7 +94,6 @@ public class IPsTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Get Ips");
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,7 +107,6 @@ public class IPsTable extends Table {
|
||||
return;
|
||||
}
|
||||
|
||||
Benchmark.start("Save Ips");
|
||||
ips.removeAll(getIPAddresses(userId));
|
||||
|
||||
if (ips.isEmpty()) {
|
||||
@ -141,7 +138,6 @@ public class IPsTable extends Table {
|
||||
}
|
||||
} finally {
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Save Ips");
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +234,6 @@ public class IPsTable extends Table {
|
||||
}
|
||||
|
||||
if (commitRequired) {
|
||||
Log.debug("Database", "Executing ips batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
}
|
||||
} finally {
|
||||
|
@ -258,7 +258,6 @@ public class KillsTable extends Table {
|
||||
}
|
||||
|
||||
if (commitRequired) {
|
||||
Log.debug("Database", "Executing kills batch: " + i);
|
||||
statement.executeBatch();
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,6 @@ public class NicknamesTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<String> getNicknames(int userId) throws SQLException {
|
||||
Benchmark.start("Get Nicknames");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -109,7 +108,6 @@ public class NicknamesTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Get Nicknames");
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +121,6 @@ public class NicknamesTable extends Table {
|
||||
if (names == null || names.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Benchmark.start("Save Nicknames");
|
||||
names.removeAll(getNicknames(userId));
|
||||
if (names.isEmpty()) {
|
||||
return;
|
||||
@ -136,23 +133,19 @@ public class NicknamesTable extends Table {
|
||||
+ columnNick
|
||||
+ ") VALUES (?, ?, ?)");
|
||||
boolean commitRequired = false;
|
||||
int i = 0;
|
||||
for (String name : names) {
|
||||
statement.setInt(1, userId);
|
||||
statement.setInt(2, (name.equals(lastNick)) ? 1 : 0);
|
||||
statement.setString(3, name);
|
||||
statement.addBatch();
|
||||
commitRequired = true;
|
||||
i++;
|
||||
}
|
||||
if (commitRequired) {
|
||||
Log.debug("Database", "Executing nicknames batch: " + i);
|
||||
statement.executeBatch();
|
||||
|
||||
}
|
||||
} finally {
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Save Nicknames");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,6 @@ public class SessionsTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<SessionData> getSessionData(int userId) throws SQLException {
|
||||
Benchmark.start("Get Sessions");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -75,7 +74,6 @@ public class SessionsTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Get Sessions");
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,8 +253,6 @@ public class SessionsTable extends Table {
|
||||
statement.setLong(3, session.getSessionEnd());
|
||||
statement.addBatch();
|
||||
}
|
||||
|
||||
Log.debug("Database", "Executing session batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
} finally {
|
||||
close(statement);
|
||||
|
@ -160,8 +160,6 @@ public class TPSTable extends Table {
|
||||
statement.setDouble(7, tps.getChunksLoaded());
|
||||
statement.addBatch();
|
||||
}
|
||||
|
||||
Log.debug("Database", "Executing tps batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
} finally {
|
||||
close(statement);
|
||||
|
@ -107,7 +107,6 @@ public abstract class Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
protected PreparedStatement prepareStatement(String sql) throws SQLException {
|
||||
Log.debug("Database", sql);
|
||||
return getConnection().prepareStatement(sql);
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,6 @@ public class UsersTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public UserData getUserData(UUID uuid) throws SQLException {
|
||||
Benchmark.start("Get UserData");
|
||||
boolean containsBukkitData = getContainsBukkitData(uuid);
|
||||
UserData data = null;
|
||||
if (containsBukkitData) {
|
||||
@ -284,7 +283,6 @@ public class UsersTable extends Table {
|
||||
data = new UserData(Fetch.getIOfflinePlayer(uuid));
|
||||
addUserInformationToUserData(data);
|
||||
}
|
||||
Benchmark.stop("Database", "Get UserData");
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -312,7 +310,7 @@ public class UsersTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<UserData> getUserData(Collection<UUID> uuids) throws SQLException {
|
||||
Benchmark.start("Get UserData Multiple");
|
||||
Benchmark.start("Get UserInfo Multiple");
|
||||
List<UUID> containsBukkitData = getContainsBukkitData(uuids);
|
||||
List<UserData> datas = new ArrayList<>();
|
||||
datas.addAll(getUserDataForKnown(containsBukkitData));
|
||||
@ -330,7 +328,7 @@ public class UsersTable extends Table {
|
||||
datas.addAll(noBukkitData);
|
||||
}
|
||||
|
||||
Benchmark.stop("Database", "Get UserData Multiple");
|
||||
Benchmark.stop("Database", "Get UserInfo Multiple");
|
||||
return datas;
|
||||
}
|
||||
|
||||
@ -365,7 +363,6 @@ public class UsersTable extends Table {
|
||||
}
|
||||
|
||||
private UserData getUserDataForKnown(UUID uuid) throws SQLException {
|
||||
Benchmark.start("getUserDataForKnown UserData");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -401,13 +398,11 @@ public class UsersTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "getUserDataForKnown UserData");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<UserData> getUserDataForKnown(Collection<UUID> uuids) throws SQLException {
|
||||
Benchmark.start("getUserDataForKnown Multiple");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
List<UserData> datas = new ArrayList<>();
|
||||
@ -448,7 +443,6 @@ public class UsersTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "getUserDataForKnown Multiple");
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
@ -458,7 +452,6 @@ public class UsersTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public void addUserInformationToUserData(UserData data) throws SQLException {
|
||||
Benchmark.start("addUserInformationToUserData");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -488,7 +481,6 @@ public class UsersTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "addUserInformationToUserData");
|
||||
}
|
||||
}
|
||||
|
||||
@ -497,7 +489,6 @@ public class UsersTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public void addUserInformationToUserData(List<UserData> data) throws SQLException {
|
||||
Benchmark.start("addUserInformationToUserData Multiple");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
@ -533,7 +524,6 @@ public class UsersTable extends Table {
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "addUserInformationToUserData Multiple");
|
||||
}
|
||||
}
|
||||
|
||||
@ -542,7 +532,6 @@ public class UsersTable extends Table {
|
||||
* @throws SQLException
|
||||
*/
|
||||
public void saveUserDataInformation(UserData data) throws SQLException {
|
||||
Benchmark.start("Save UserInfo");
|
||||
PreparedStatement statement = null;
|
||||
try {
|
||||
UUID uuid = data.getUuid();
|
||||
@ -598,7 +587,6 @@ public class UsersTable extends Table {
|
||||
}
|
||||
} finally {
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Save UserInfo");
|
||||
}
|
||||
}
|
||||
|
||||
@ -738,7 +726,6 @@ public class UsersTable extends Table {
|
||||
statement.addBatch();
|
||||
}
|
||||
|
||||
Log.debug("Database", "Executing users batch: " + batchSize);
|
||||
statement.executeBatch();
|
||||
} finally {
|
||||
close(statement);
|
||||
@ -801,7 +788,6 @@ public class UsersTable extends Table {
|
||||
i++;
|
||||
}
|
||||
if (commitRequired) {
|
||||
Log.debug("Database", "Executing userinfo batch update: " + i);
|
||||
statement.executeBatch();
|
||||
}
|
||||
return saveLast;
|
||||
@ -863,29 +849,6 @@ public class UsersTable extends Table {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return @throws SQLException
|
||||
*/
|
||||
public Map<Integer, Integer> getLoginTimes() throws SQLException {
|
||||
Benchmark.start("Get Logintimes");
|
||||
PreparedStatement statement = null;
|
||||
ResultSet set = null;
|
||||
try {
|
||||
Map<Integer, Integer> ids = new HashMap<>();
|
||||
statement = prepareStatement("SELECT " + columnID + ", " + columnLoginTimes + " FROM " + tableName);
|
||||
set = statement.executeQuery();
|
||||
while (set.next()) {
|
||||
Integer id = set.getInt(columnID);
|
||||
ids.put(id, set.getInt(columnLoginTimes));
|
||||
}
|
||||
return ids;
|
||||
} finally {
|
||||
close(set);
|
||||
close(statement);
|
||||
Benchmark.stop("Database", "Get Logintimes");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user