Added debug messages to diagnose a critical CPU usage issue

This commit is contained in:
MattBDev 2020-02-13 18:15:45 -05:00
parent 73c5e34040
commit 7e7fc89e81
2 changed files with 14 additions and 11 deletions

View File

@ -70,12 +70,14 @@ public interface IBatchProcessor {
} }
try { try {
int layer = (minY - 15) >> 4; int layer = (minY - 15) >> 4;
Fawe.imp().debug("layer: " + layer + " < " +((maxY + 15) >> 4));
while (layer < (maxY + 15) >> 4) { while (layer < (maxY + 15) >> 4) {
if (layer > -1) { if (layer > -1) {
if (set.hasSection(layer)) { if (set.hasSection(layer)) {
return true; return true;
} }
layer++; layer++;
Fawe.imp().debug("layer++ : " + layer);
} }
} }
} catch (ArrayIndexOutOfBoundsException exception) { } catch (ArrayIndexOutOfBoundsException exception) {

View File

@ -35,6 +35,7 @@ import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.Identifiable;
import com.sk89q.worldedit.util.auth.Subject; import com.sk89q.worldedit.util.auth.Subject;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -110,7 +111,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab
* @param component The component to print * @param component The component to print
*/ */
default void printError(Component component) { default void printError(Component component) {
print(TranslatableComponent.of("fawe.error", component)); print(component.color(TextColor.RED));
} }
/** /**
@ -119,7 +120,16 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab
* @param component The component to print * @param component The component to print
*/ */
default void printInfo(Component component) { default void printInfo(Component component) {
print(TranslatableComponent.of("fawe.info", component)); print(component.color(TextColor.LIGHT_PURPLE));
}
/**
* Print a WorldEdit message.
*
* @param component The component to print
*/
default void printDebug(Component component) {
print(component.color(TextColor.GRAY));
} }
/** /**
@ -136,15 +146,6 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab
*/ */
boolean canDestroyBedrock(); boolean canDestroyBedrock();
/**
* Print a WorldEdit message.
*
* @param component The component to print
*/
default void printDebug(Component component) {
print(TranslatableComponent.of("fawe.debug", component));
}
/** /**
* Return whether this actor is a player. * Return whether this actor is a player.
* *