-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
117 changed files
with
66 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: 404Setup <153366651+404Setup@users.noreply.github.com> | ||
Date: Sun, 20 Oct 2024 10:27:18 +0800 | ||
Subject: [PATCH] Modify Metrics | ||
|
||
|
||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java | ||
index 22c9c5ef26229c57fb27776b5a49cc77dcdbe545..3419beaf9ce891fe63aa186e61acd43931c005e2 100644 | ||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java | ||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java | ||
@@ -1,5 +1,7 @@ | ||
package com.destroystokyo.paper; | ||
|
||
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; | ||
+import it.unimi.dsi.fastutil.objects.ObjectArrayList; | ||
import net.minecraft.server.MinecraftServer; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.configuration.file.YamlConfiguration; | ||
@@ -35,7 +37,7 @@ public class Metrics { | ||
|
||
// Executor service for requests | ||
// We use an executor service because the Bukkit scheduler is affected by server lags | ||
- private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); | ||
+ private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, one.tranic.vine.util.AnyThread.getFactory()); | ||
|
||
// The version of this bStats class | ||
public static final int B_STATS_VERSION = 1; | ||
@@ -56,7 +58,7 @@ public class Metrics { | ||
private final String serverUUID; | ||
|
||
// A list with all custom charts | ||
- private final List<CustomChart> charts = new ArrayList<>(); | ||
+ private final List<CustomChart> charts = new ObjectArrayList<>(); | ||
|
||
/** | ||
* Class constructor. | ||
@@ -606,9 +608,9 @@ public class Metrics { | ||
metrics.addCustomChart(new Metrics.SimplePie("vine_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // ShreddedPaper // Vine | ||
|
||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { | ||
- Map<String, Map<String, Integer>> map = new HashMap<>(); | ||
+ Map<String, Map<String, Integer>> map = new Object2ObjectOpenHashMap<>(); | ||
String javaVersion = System.getProperty("java.version"); | ||
- Map<String, Integer> entry = new HashMap<>(); | ||
+ Map<String, Integer> entry = new Object2ObjectOpenHashMap<>(); | ||
entry.put(javaVersion, 1); | ||
|
||
// http://openjdk.java.net/jeps/223 | ||
@@ -637,7 +639,7 @@ public class Metrics { | ||
})); | ||
|
||
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> { | ||
- Map<String, Map<String, Integer>> map = new HashMap<>(); | ||
+ Map<String, Map<String, Integer>> map = new Object2ObjectOpenHashMap<>(); | ||
|
||
// count legacy plugins | ||
int legacy = 0; | ||
@@ -648,7 +650,7 @@ public class Metrics { | ||
} | ||
|
||
// insert real value as lower dimension | ||
- Map<String, Integer> entry = new HashMap<>(); | ||
+ Map<String, Integer> entry = new Object2ObjectOpenHashMap<>(); | ||
entry.put(String.valueOf(legacy), 1); | ||
|
||
// create buckets as higher dimension |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.