Skip to content

Commit

Permalink
Modify Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Oct 22, 2024
1 parent 31d3c56 commit daec2f4
Show file tree
Hide file tree
Showing 117 changed files with 66 additions and 13 deletions.
66 changes: 66 additions & 0 deletions patches/server/0004-Modify-Metrics.patch
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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ Date: Thu, 15 Aug 2024 21:42:18 +0800
Subject: [PATCH] Virtual threads 1.0


diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 22c9c5ef26229c57fb27776b5a49cc77dcdbe545..d6ae8b61dd33da919fd81a11032bfe187d8caa6c 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -35,7 +35,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;
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilServicesKeyInfo.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilServicesKeyInfo.java
index 5dbaf7689363719501d9b41f9537ebd4677e32a6..370c98f9f74876ad62c1b412a79cf986f9adb441 100644
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilServicesKeyInfo.java
Expand Down
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.

0 comments on commit daec2f4

Please sign in to comment.