diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java index 65357bd67..b9302786c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/APIRequestHandler.java @@ -4,6 +4,7 @@ */ package main.java.com.djrapitops.plan.systems.webserver; +import com.djrapitops.plugin.api.Benchmark; import com.djrapitops.plugin.api.utility.log.Log; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; @@ -31,11 +32,12 @@ public class APIRequestHandler implements HttpHandler { public void handle(HttpExchange exchange) throws IOException { Headers responseHeaders = exchange.getResponseHeaders(); Request request = new Request(exchange); + String requestString = request.toString(); + Benchmark.start("", requestString); + int responseCode = -1; try { Response response = responseHandler.getAPIResponse(request); - if (Settings.DEV_MODE.isTrue()) { - Log.debug(request.toString() + " Response code: " + response.getCode()); - } + responseCode = response.getCode(); response.setResponseHeaders(responseHeaders); response.send(exchange); } catch (Exception e) { @@ -44,6 +46,9 @@ public class APIRequestHandler implements HttpHandler { } } finally { exchange.close(); + if (Settings.DEV_MODE.isTrue()) { + Log.debug(requestString + " Response code: " + responseCode + " took " + Benchmark.stop("", requestString) + " ms"); + } } } diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/RequestHandler.java b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/RequestHandler.java index 4e2bb2c87..6aae85b93 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/webserver/RequestHandler.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/webserver/RequestHandler.java @@ -4,6 +4,7 @@ */ package main.java.com.djrapitops.plan.systems.webserver; +import com.djrapitops.plugin.api.Benchmark; import com.djrapitops.plugin.api.utility.log.Log; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; @@ -32,12 +33,12 @@ public class RequestHandler implements HttpHandler { public void handle(HttpExchange exchange) throws IOException { Headers responseHeaders = exchange.getResponseHeaders(); Request request = new Request(exchange); - + String requestString = request.toString(); + Benchmark.start("", requestString); + int responseCode = -1; try { Response response = responseHandler.getResponse(request); - if (Settings.DEV_MODE.isTrue()) { - Log.debug(request.toString() + " Response code: " + response.getCode()); - } + responseCode = response.getCode(); if (response instanceof PromptAuthorizationResponse) { responseHeaders.set("WWW-Authenticate", "Basic realm=\"/\";"); } @@ -49,6 +50,9 @@ public class RequestHandler implements HttpHandler { } } finally { exchange.close(); + if (Settings.DEV_MODE.isTrue()) { + Log.debug(requestString + " Response code: " + responseCode+" took "+Benchmark.stop("", requestString)+" ms"); + } } } diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/AnalysisPluginsTabContentCreator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/AnalysisPluginsTabContentCreator.java index 36aa2c248..b1d6c967b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/AnalysisPluginsTabContentCreator.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/structure/AnalysisPluginsTabContentCreator.java @@ -87,7 +87,7 @@ public class AnalysisPluginsTabContentCreator { } public static void appendThird(PluginData pluginData, InspectContainer container, StringBuilder generalTab) { - generalTab.append("