13
0
geforkt von Mirrors/Paper

Add config option to specify timings url (#6256)

Dieser Commit ist enthalten in:
Max Lee 2021-07-25 08:10:30 +01:00
Ursprung 8b32eebc95
Commit b7ac1102ba
2 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1722,7 +1722,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.plugin.java.PluginClassLoader;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
@ -1737,6 +1736,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static final FullServerTickHandler FULL_SERVER_TICK = new FullServerTickHandler();
+ public static final TimingHandler TIMINGS_TICK = Timings.ofSafe("Timings Tick", FULL_SERVER_TICK);
+ public static final Timing PLUGIN_GROUP_HANDLER = Timings.ofSafe("Plugins");
+ public static String url = "https://timings.aikar.co/";
+ public static List<String> hiddenConfigs = new ArrayList<String>();
+ public static boolean privacy = false;
+

Datei anzeigen

@ -473,7 +473,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ String response = null;
+ String timingsURL = null;
+ try {
+ HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
+ HttpURLConnection con = (HttpURLConnection) new URL(TimingsManager.url + "post").openConnection();
+ con.setDoOutput(true);
+ String hostName = "BrokenHost";
+ try {
@ -697,6 +697,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private static void timings() {
+ boolean timings = getBoolean("timings.enabled", true);
+ boolean verboseTimings = getBoolean("timings.verbose", true);
+ TimingsManager.url = getString("timings.url", "https://timings.aikar.co/");
+ if (!TimingsManager.url.endsWith("/")) {
+ TimingsManager.url += "/";
+ }
+ TimingsManager.privacy = getBoolean("timings.server-name-privacy", false);
+ TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret"));
+ if (!TimingsManager.hiddenConfigs.contains("settings.velocity-support.secret")) {
@ -713,6 +717,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Timings.setHistoryLength(timingHistoryLength * 20);
+
+ log("Timings: " + timings +
+ " - Url: " + TimingsManager.url +
+ " - Verbose: " + verboseTimings +
+ " - Interval: " + timeSummary(Timings.getHistoryInterval() / 20) +
+ " - Length: " + timeSummary(Timings.getHistoryLength() / 20) +