mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Timings v2 cleanups - potential overflow fix and fix bad hostnames
if hostname is invalid on system, just use a static string also cleans up visibility of a lot of code, hopefully will help jvm optimize more.
This commit is contained in:
parent
22f2c98375
commit
106787f894
1 changed files with 107 additions and 70 deletions
|
@ -1,4 +1,4 @@
|
||||||
From 6492832b42e6eaca00bc3cf12ab9782a03c1e186 Mon Sep 17 00:00:00 2001
|
From e5b3390ab5419f3585ef52c28b50153a75da9bed Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Mon, 29 Feb 2016 18:48:17 -0600
|
Date: Mon, 29 Feb 2016 18:48:17 -0600
|
||||||
Subject: [PATCH] Timings v2
|
Subject: [PATCH] Timings v2
|
||||||
|
@ -6,16 +6,16 @@ Subject: [PATCH] Timings v2
|
||||||
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..007ab9c
|
index 0000000..e5a98af
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
|
||||||
@@ -0,0 +1,79 @@
|
@@ -0,0 +1,81 @@
|
||||||
+package co.aikar.timings;
|
+package co.aikar.timings;
|
||||||
+
|
+
|
||||||
+import static co.aikar.timings.TimingsManager.*;
|
+import static co.aikar.timings.TimingsManager.*;
|
||||||
+
|
+
|
||||||
+public class FullServerTickHandler extends TimingHandler {
|
+public class FullServerTickHandler extends TimingHandler {
|
||||||
+ static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null, false);
|
+ private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null, false);
|
||||||
+ final TimingData minuteData;
|
+ final TimingData minuteData;
|
||||||
+ double avgFreeMemory = -1D;
|
+ double avgFreeMemory = -1D;
|
||||||
+ double avgUsedMemory = -1D;
|
+ double avgUsedMemory = -1D;
|
||||||
|
@ -39,7 +39,7 @@ index 0000000..007ab9c
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void stopTiming() {
|
+ public void stopTiming() {
|
||||||
+ super.stopTiming();
|
+ super.stopTiming();
|
||||||
+ if (!enabled) {
|
+ if (!isEnabled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ if (TimingHistory.timedTicks % 20 == 0) {
|
+ if (TimingHistory.timedTicks % 20 == 0) {
|
||||||
|
@ -65,9 +65,11 @@ index 0000000..007ab9c
|
||||||
+ CURRENT = TIMINGS_TICK;
|
+ CURRENT = TIMINGS_TICK;
|
||||||
+ TIMINGS_TICK.addDiff(diff);
|
+ TIMINGS_TICK.addDiff(diff);
|
||||||
+ // addDiff for TIMINGS_TICK incremented this, bring it back down to 1 per tick.
|
+ // addDiff for TIMINGS_TICK incremented this, bring it back down to 1 per tick.
|
||||||
+ record.curTickCount--;
|
+ record.setCurTickCount(record.getCurTickCount()-1);
|
||||||
+ minuteData.curTickTotal = record.curTickTotal;
|
+
|
||||||
+ minuteData.curTickCount = 1;
|
+ minuteData.setCurTickTotal(record.getCurTickTotal());
|
||||||
|
+ minuteData.setCurTickCount(1);
|
||||||
|
+
|
||||||
+ boolean violated = isViolated();
|
+ boolean violated = isViolated();
|
||||||
+ minuteData.processTick(violated);
|
+ minuteData.processTick(violated);
|
||||||
+ TIMINGS_TICK.processTick(violated);
|
+ TIMINGS_TICK.processTick(violated);
|
||||||
|
@ -86,7 +88,7 @@ index 0000000..007ab9c
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ boolean isViolated() {
|
+ boolean isViolated() {
|
||||||
+ return record.curTickTotal > 50000000;
|
+ return record.getCurTickTotal() > 50000000;
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
|
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
|
||||||
|
@ -323,10 +325,10 @@ index 0000000..8b2d1b8
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java
|
diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..b62e428
|
index 0000000..f222d6b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingData.java
|
+++ b/src/main/java/co/aikar/timings/TimingData.java
|
||||||
@@ -0,0 +1,105 @@
|
@@ -0,0 +1,120 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
+ * This file is licensed under the MIT License (MIT).
|
||||||
+ *
|
+ *
|
||||||
|
@ -352,8 +354,6 @@ index 0000000..b62e428
|
||||||
+ */
|
+ */
|
||||||
+package co.aikar.timings;
|
+package co.aikar.timings;
|
||||||
+
|
+
|
||||||
+import com.google.common.base.Function;
|
|
||||||
+
|
|
||||||
+import java.util.List;
|
+import java.util.List;
|
||||||
+
|
+
|
||||||
+import static co.aikar.util.JSONUtil.toArray;
|
+import static co.aikar.util.JSONUtil.toArray;
|
||||||
|
@ -364,26 +364,19 @@ index 0000000..b62e428
|
||||||
+ * This is broken out to reduce memory usage
|
+ * This is broken out to reduce memory usage
|
||||||
+ */
|
+ */
|
||||||
+class TimingData {
|
+class TimingData {
|
||||||
+ static Function<Integer, TimingData> LOADER = new Function<Integer, TimingData>() {
|
+ private final int id;
|
||||||
+ @Override
|
+ private int count = 0;
|
||||||
+ public TimingData apply(Integer input) {
|
+ private int lagCount = 0;
|
||||||
+ return new TimingData(input);
|
+ private long totalTime = 0;
|
||||||
+ }
|
+ private long lagTotalTime = 0;
|
||||||
+ };
|
+ private int curTickCount = 0;
|
||||||
+ int id;
|
+ private long curTickTotal = 0;
|
||||||
+ int count = 0;
|
|
||||||
+ int lagCount = 0;
|
|
||||||
+ long totalTime = 0;
|
|
||||||
+ long lagTotalTime = 0;
|
|
||||||
+
|
|
||||||
+ int curTickCount = 0;
|
|
||||||
+ int curTickTotal = 0;
|
|
||||||
+
|
+
|
||||||
+ TimingData(int id) {
|
+ TimingData(int id) {
|
||||||
+ this.id = id;
|
+ this.id = id;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ TimingData(TimingData data) {
|
+ private TimingData(TimingData data) {
|
||||||
+ this.id = data.id;
|
+ this.id = data.id;
|
||||||
+ this.totalTime = data.totalTime;
|
+ this.totalTime = data.totalTime;
|
||||||
+ this.lagTotalTime = data.lagTotalTime;
|
+ this.lagTotalTime = data.lagTotalTime;
|
||||||
|
@ -420,8 +413,8 @@ index 0000000..b62e428
|
||||||
+ return new TimingData(this);
|
+ return new TimingData(this);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public List export() {
|
+ List<Object> export() {
|
||||||
+ List list = toArray(
|
+ List<Object> list = toArray(
|
||||||
+ id,
|
+ id,
|
||||||
+ count,
|
+ count,
|
||||||
+ totalTime);
|
+ totalTime);
|
||||||
|
@ -431,13 +424,37 @@ index 0000000..b62e428
|
||||||
+ }
|
+ }
|
||||||
+ return list;
|
+ return list;
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ boolean hasData() {
|
||||||
|
+ return count > 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ long getTotalTime() {
|
||||||
|
+ return totalTime;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ int getCurTickCount() {
|
||||||
|
+ return curTickCount;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ void setCurTickCount(int curTickCount) {
|
||||||
|
+ this.curTickCount = curTickCount;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ long getCurTickTotal() {
|
||||||
|
+ return curTickTotal;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ void setCurTickTotal(long curTickTotal) {
|
||||||
|
+ this.curTickTotal = curTickTotal;
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
|
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..0914417
|
index 0000000..916b6f9
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
|
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
|
||||||
@@ -0,0 +1,192 @@
|
@@ -0,0 +1,209 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
+ * This file is licensed under the MIT License (MIT).
|
||||||
+ *
|
+ *
|
||||||
|
@ -475,19 +492,19 @@ index 0000000..0914417
|
||||||
+ final int id = idPool++;
|
+ final int id = idPool++;
|
||||||
+
|
+
|
||||||
+ final String name;
|
+ final String name;
|
||||||
+ final boolean verbose;
|
+ private final boolean verbose;
|
||||||
+
|
+
|
||||||
+ final Int2ObjectOpenHashMap<TimingData> children = new LoadingIntMap<>(TimingData.LOADER);
|
+ private final Int2ObjectOpenHashMap<TimingData> children = new LoadingIntMap<>(TimingData::new);
|
||||||
+
|
+
|
||||||
+ final TimingData record;
|
+ final TimingData record;
|
||||||
+ final TimingHandler groupHandler;
|
+ private final TimingHandler groupHandler;
|
||||||
+
|
+
|
||||||
+ long start = 0;
|
+ private long start = 0;
|
||||||
+ int timingDepth = 0;
|
+ private int timingDepth = 0;
|
||||||
+ boolean added;
|
+ private boolean added;
|
||||||
+ boolean timed;
|
+ private boolean timed;
|
||||||
+ boolean enabled;
|
+ private boolean enabled;
|
||||||
+ TimingHandler parent;
|
+ private TimingHandler parent;
|
||||||
+
|
+
|
||||||
+ TimingHandler(TimingIdentifier id) {
|
+ TimingHandler(TimingIdentifier id) {
|
||||||
+ if (id.name.startsWith("##")) {
|
+ if (id.name.startsWith("##")) {
|
||||||
|
@ -510,7 +527,7 @@ index 0000000..0914417
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ void processTick(boolean violated) {
|
+ void processTick(boolean violated) {
|
||||||
+ if (timingDepth != 0 || record.curTickCount == 0) {
|
+ if (timingDepth != 0 || record.getCurTickCount() == 0) {
|
||||||
+ timingDepth = 0;
|
+ timingDepth = 0;
|
||||||
+ start = 0;
|
+ start = 0;
|
||||||
+ return;
|
+ return;
|
||||||
|
@ -629,13 +646,30 @@ index 0000000..0914417
|
||||||
+ public boolean isSpecial() {
|
+ public boolean isSpecial() {
|
||||||
+ return this == TimingsManager.FULL_SERVER_TICK || this == TimingsManager.TIMINGS_TICK;
|
+ return this == TimingsManager.FULL_SERVER_TICK || this == TimingsManager.TIMINGS_TICK;
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ boolean isTimed() {
|
||||||
|
+ return timed;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public boolean isEnabled() {
|
||||||
|
+ return enabled;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ TimingData[] cloneChildren() {
|
||||||
|
+ final TimingData[] clonedChildren = new TimingData[children.size()];
|
||||||
|
+ int i = 0;
|
||||||
|
+ for (TimingData child : children.values()) {
|
||||||
|
+ clonedChildren[i++] = child.clone();
|
||||||
|
+ }
|
||||||
|
+ return clonedChildren;
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..9206569
|
index 0000000..389875b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
|
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||||
@@ -0,0 +1,338 @@
|
@@ -0,0 +1,342 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
+ * This file is licensed under the MIT License (MIT).
|
||||||
+ *
|
+ *
|
||||||
|
@ -728,7 +762,7 @@ index 0000000..9206569
|
||||||
+ ticks += mp.ticksRecord.timed;
|
+ ticks += mp.ticksRecord.timed;
|
||||||
+ }
|
+ }
|
||||||
+ this.totalTicks = ticks;
|
+ this.totalTicks = ticks;
|
||||||
+ this.totalTime = FULL_SERVER_TICK.record.totalTime;
|
+ this.totalTime = FULL_SERVER_TICK.record.getTotalTime();
|
||||||
+ this.entries = new TimingHistoryEntry[TimingsManager.HANDLERS.size()];
|
+ this.entries = new TimingHistoryEntry[TimingsManager.HANDLERS.size()];
|
||||||
+
|
+
|
||||||
+ int i = 0;
|
+ int i = 0;
|
||||||
|
@ -795,7 +829,7 @@ index 0000000..9206569
|
||||||
+ });
|
+ });
|
||||||
+ }
|
+ }
|
||||||
+ static class RegionData {
|
+ static class RegionData {
|
||||||
+ private final RegionId regionId;
|
+ final RegionId regionId;
|
||||||
+ @SuppressWarnings("Guava")
|
+ @SuppressWarnings("Guava")
|
||||||
+ static Function<RegionId, RegionData> LOADER = new Function<RegionId, RegionData>() {
|
+ static Function<RegionId, RegionData> LOADER = new Function<RegionId, RegionData>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -809,8 +843,12 @@ index 0000000..9206569
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean equals(Object o) {
|
+ public boolean equals(Object o) {
|
||||||
+ if (this == o) return true;
|
+ if (this == o) {
|
||||||
+ if (o == null || getClass() != o.getClass()) return false;
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ if (o == null || getClass() != o.getClass()) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ RegionData that = (RegionData) o;
|
+ RegionData that = (RegionData) o;
|
||||||
+
|
+
|
||||||
|
@ -881,7 +919,7 @@ index 0000000..9206569
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public Object apply(TimingHistoryEntry entry) {
|
+ public Object apply(TimingHistoryEntry entry) {
|
||||||
+ TimingData record = entry.data;
|
+ TimingData record = entry.data;
|
||||||
+ if (record.count == 0) {
|
+ if (!record.hasData()) {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ return entry.export();
|
+ return entry.export();
|
||||||
|
@ -907,7 +945,7 @@ index 0000000..9206569
|
||||||
+ final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory;
|
+ final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory;
|
||||||
+ final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
|
+ final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
|
||||||
+
|
+
|
||||||
+ public List export() {
|
+ List<Object> export() {
|
||||||
+ return toArray(
|
+ return toArray(
|
||||||
+ time,
|
+ time,
|
||||||
+ Math.round(tps * 100D) / 100D,
|
+ Math.round(tps * 100D) / 100D,
|
||||||
|
@ -956,9 +994,9 @@ index 0000000..9206569
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @SuppressWarnings("WeakerAccess")
|
+
|
||||||
+ public static class Counter {
|
+ private static class Counter {
|
||||||
+ int count = 0;
|
+ private int count = 0;
|
||||||
+ @SuppressWarnings({"rawtypes", "SuppressionAnnotation", "Guava"})
|
+ @SuppressWarnings({"rawtypes", "SuppressionAnnotation", "Guava"})
|
||||||
+ static Function LOADER = new LoadingMap.Feeder<Counter>() {
|
+ static Function LOADER = new LoadingMap.Feeder<Counter>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -976,10 +1014,10 @@ index 0000000..9206569
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..a5c5dfd
|
index 0000000..0e114eb
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
+++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
|
||||||
@@ -0,0 +1,59 @@
|
@@ -0,0 +1,55 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
+ * This file is licensed under the MIT License (MIT).
|
||||||
+ *
|
+ *
|
||||||
|
@ -1013,19 +1051,15 @@ index 0000000..a5c5dfd
|
||||||
+
|
+
|
||||||
+class TimingHistoryEntry {
|
+class TimingHistoryEntry {
|
||||||
+ final TimingData data;
|
+ final TimingData data;
|
||||||
+ final TimingData[] children;
|
+ private final TimingData[] children;
|
||||||
+
|
+
|
||||||
+ TimingHistoryEntry(TimingHandler handler) {
|
+ TimingHistoryEntry(TimingHandler handler) {
|
||||||
+ this.data = handler.record.clone();
|
+ this.data = handler.record.clone();
|
||||||
+ children = new TimingData[handler.children.size()];
|
+ children = handler.cloneChildren();
|
||||||
+ int i = 0;
|
|
||||||
+ for (TimingData child : handler.children.values()) {
|
|
||||||
+ children[i++] = child.clone();
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ List export() {
|
+ List<Object> export() {
|
||||||
+ List result = data.export();
|
+ List<Object> result = data.export();
|
||||||
+ if (children.length > 0) {
|
+ if (children.length > 0) {
|
||||||
+ result.add(
|
+ result.add(
|
||||||
+ toArrayMapper(children, new Function<TimingData, Object>() {
|
+ toArrayMapper(children, new Function<TimingData, Object>() {
|
||||||
|
@ -1544,10 +1578,10 @@ index 0000000..3dba3aa
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..17f8c6f
|
index 0000000..62cbd39
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||||
@@ -0,0 +1,373 @@
|
@@ -0,0 +1,376 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
+ * This file is licensed under the MIT License (MIT).
|
||||||
+ *
|
+ *
|
||||||
|
@ -1595,7 +1629,6 @@ index 0000000..17f8c6f
|
||||||
+import java.io.OutputStream;
|
+import java.io.OutputStream;
|
||||||
+import java.lang.management.GarbageCollectorMXBean;
|
+import java.lang.management.GarbageCollectorMXBean;
|
||||||
+import java.lang.management.ManagementFactory;
|
+import java.lang.management.ManagementFactory;
|
||||||
+import java.lang.management.OperatingSystemMXBean;
|
|
||||||
+import java.lang.management.RuntimeMXBean;
|
+import java.lang.management.RuntimeMXBean;
|
||||||
+import java.net.HttpURLConnection;
|
+import java.net.HttpURLConnection;
|
||||||
+import java.net.InetAddress;
|
+import java.net.InetAddress;
|
||||||
|
@ -1616,7 +1649,7 @@ index 0000000..17f8c6f
|
||||||
+ private final Map out;
|
+ private final Map out;
|
||||||
+ private final TimingHistory[] history;
|
+ private final TimingHistory[] history;
|
||||||
+
|
+
|
||||||
+ TimingsExport(CommandSender sender, Map out, TimingHistory[] history) {
|
+ private TimingsExport(CommandSender sender, Map out, TimingHistory[] history) {
|
||||||
+ super("Timings paste thread");
|
+ super("Timings paste thread");
|
||||||
+ this.sender = sender;
|
+ this.sender = sender;
|
||||||
+ this.out = out;
|
+ this.out = out;
|
||||||
|
@ -1689,7 +1722,7 @@ index 0000000..17f8c6f
|
||||||
+ Map handlers = createObject();
|
+ Map handlers = createObject();
|
||||||
+ for (TimingIdentifier.TimingGroup group : TimingIdentifier.GROUP_MAP.values()) {
|
+ for (TimingIdentifier.TimingGroup group : TimingIdentifier.GROUP_MAP.values()) {
|
||||||
+ for (TimingHandler id : group.handlers) {
|
+ for (TimingHandler id : group.handlers) {
|
||||||
+ if (!id.timed && !id.isSpecial()) {
|
+ if (!id.isTimed() && !id.isSpecial()) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ handlers.put(id.id, toArray(
|
+ handlers.put(id.id, toArray(
|
||||||
|
@ -1856,7 +1889,11 @@ index 0000000..17f8c6f
|
||||||
+ try {
|
+ try {
|
||||||
+ HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
|
+ HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
|
||||||
+ con.setDoOutput(true);
|
+ con.setDoOutput(true);
|
||||||
+ con.setRequestProperty("User-Agent", "Spigot/" + Bukkit.getServerName() + "/" + InetAddress.getLocalHost().getHostName());
|
+ String hostName = "BrokenHost";
|
||||||
|
+ try {
|
||||||
|
+ hostName = InetAddress.getLocalHost().getHostName();
|
||||||
|
+ } catch(Exception ignored) {}
|
||||||
|
+ con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getServerName() + "/" + hostName);
|
||||||
+ con.setRequestMethod("POST");
|
+ con.setRequestMethod("POST");
|
||||||
+ con.setInstanceFollowRedirects(false);
|
+ con.setInstanceFollowRedirects(false);
|
||||||
+
|
+
|
||||||
|
@ -3598,5 +3635,5 @@ index 8d98297..7e89b97 100644
|
||||||
- }
|
- }
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.9.0.windows.1
|
2.9.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue