Skip to content

Commit

Permalink
Include server brand in viewer payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Jul 7, 2024
1 parent dface59 commit c94eba9
Show file tree
Hide file tree
Showing 125 changed files with 124 additions and 224 deletions.
1 change: 0 additions & 1 deletion spark-api/src/main/java/me/lucko/spark/api/Spark.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import me.lucko.spark.api.statistic.misc.DoubleAverageInfo;
import me.lucko.spark.api.statistic.types.DoubleStatistic;
import me.lucko.spark.api.statistic.types.GenericStatistic;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.Unmodifiable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import me.lucko.spark.api.statistic.Statistic;
import me.lucko.spark.api.statistic.StatisticWindow;

import org.checkerframework.checker.nullness.qual.NonNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import me.lucko.spark.api.statistic.Statistic;
import me.lucko.spark.api.statistic.StatisticWindow;

import org.checkerframework.checker.nullness.qual.NonNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bukkit;

import me.lucko.spark.common.sampler.source.ClassSourceLookup;

import org.bukkit.plugin.java.JavaPlugin;

import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
package me.lucko.spark.bukkit;

import me.lucko.spark.common.command.sender.AbstractCommandSender;

import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.Component;

import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bukkit;

import me.lucko.spark.common.platform.PlatformInfo;

import org.bukkit.Server;

import java.lang.reflect.Field;
Expand All @@ -44,6 +43,11 @@ public String getName() {
return "Bukkit";
}

@Override
public String getBrand() {
return this.server.getName();
}

@Override
public String getVersion() {
return this.server.getVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
package me.lucko.spark.bukkit;

import com.google.common.collect.ImmutableMap;

import me.lucko.spark.common.monitor.ping.PlayerPingProvider;

import org.bukkit.Server;
import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,23 @@

package me.lucko.spark.bukkit;

import co.aikar.timings.TimingsManager;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializer;

import me.lucko.spark.common.platform.serverconfig.ConfigParser;
import me.lucko.spark.common.platform.serverconfig.ExcludedConfigFilter;
import me.lucko.spark.common.platform.serverconfig.PropertiesConfigParser;
import me.lucko.spark.common.platform.serverconfig.ServerConfigProvider;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.configuration.MemorySection;
import org.bukkit.configuration.file.YamlConfiguration;

import co.aikar.timings.TimingsManager;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
import me.lucko.spark.common.sampler.source.SourceMetadata;
import me.lucko.spark.common.tick.TickHook;
import me.lucko.spark.common.tick.TickReporter;

import net.kyori.adventure.platform.bukkit.BukkitAudiences;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import me.lucko.spark.common.tick.AbstractTickHook;
import me.lucko.spark.common.tick.TickHook;

import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import me.lucko.spark.common.platform.world.AbstractChunkInfo;
import me.lucko.spark.common.platform.world.CountMap;
import me.lucko.spark.common.platform.world.WorldInfoProvider;

import org.bukkit.Chunk;
import org.bukkit.Server;
import org.bukkit.World;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bukkit;

import com.google.common.base.Preconditions;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
package me.lucko.spark.bukkit;

import com.destroystokyo.paper.event.server.ServerTickStartEvent;

import me.lucko.spark.common.tick.AbstractTickHook;
import me.lucko.spark.common.tick.TickHook;

import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
package me.lucko.spark.bukkit;

import com.destroystokyo.paper.event.server.ServerTickEndEvent;

import me.lucko.spark.common.tick.AbstractTickReporter;
import me.lucko.spark.common.tick.TickReporter;

import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@

package me.lucko.spark.bukkit.placeholder;

import me.lucko.spark.bukkit.BukkitSparkPlugin;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.util.SparkPlaceholder;

import be.maximvdw.placeholderapi.PlaceholderAPI;
import be.maximvdw.placeholderapi.PlaceholderReplaceEvent;
import be.maximvdw.placeholderapi.PlaceholderReplacer;
import me.lucko.spark.bukkit.BukkitSparkPlugin;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.util.SparkPlaceholder;

public class SparkMVdWPlaceholders implements PlaceholderReplacer {
private final SparkPlatform platform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import me.lucko.spark.bukkit.BukkitSparkPlugin;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.util.SparkPlaceholder;

import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bungeecord;

import me.lucko.spark.common.sampler.source.ClassSourceLookup;

import net.md_5.bungee.api.plugin.PluginDescription;

import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bungeecord;

import me.lucko.spark.common.command.sender.AbstractCommandSender;

import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
import net.kyori.adventure.text.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.bungeecord;

import me.lucko.spark.common.platform.PlatformInfo;

import net.md_5.bungee.api.ProxyServer;

public class BungeeCordPlatformInfo implements PlatformInfo {
Expand All @@ -41,6 +40,11 @@ public String getName() {
return "BungeeCord";
}

@Override
public String getBrand() {
return this.proxy.getName();
}

@Override
public String getVersion() {
return this.proxy.getVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
package me.lucko.spark.bungeecord;

import com.google.common.collect.ImmutableMap;

import me.lucko.spark.common.monitor.ping.PlayerPingProvider;

import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import me.lucko.spark.common.platform.PlatformInfo;
import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import me.lucko.spark.common.sampler.source.SourceMetadata;

import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;

import me.lucko.spark.common.command.sender.CommandSender;

import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import me.lucko.spark.api.statistic.StatisticWindow;
import me.lucko.spark.api.statistic.types.DoubleStatistic;
import me.lucko.spark.api.statistic.types.GenericStatistic;

import org.checkerframework.checker.nullness.qual.NonNull;

import java.lang.reflect.Array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import me.lucko.spark.api.gc.GarbageCollector;
import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics;

import org.checkerframework.checker.nullness.qual.NonNull;

public class GarbageCollectorInfo implements GarbageCollector {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package me.lucko.spark.common.api;

import com.google.common.collect.ImmutableMap;

import me.lucko.spark.api.Spark;
import me.lucko.spark.api.SparkProvider;
import me.lucko.spark.api.gc.GarbageCollector;
Expand All @@ -32,7 +31,6 @@
import me.lucko.spark.common.monitor.cpu.CpuMonitor;
import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics;
import me.lucko.spark.common.monitor.tick.TickStatistics;

import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
package me.lucko.spark.common.command;

import com.google.common.collect.ImmutableList;

import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.command.sender.CommandSender;

import net.kyori.adventure.text.Component;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.command.sender.CommandSender;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.JoinConfiguration;
import net.kyori.adventure.text.TextComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import me.lucko.spark.common.command.Command;
import me.lucko.spark.common.command.CommandModule;
import me.lucko.spark.common.command.tabcomplete.TabCompleter;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.ClickEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
package me.lucko.spark.common.command.modules;

import com.sun.management.GarbageCollectionNotificationInfo;

import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.command.Command;
import me.lucko.spark.common.command.CommandModule;
import me.lucko.spark.common.command.CommandResponseHandler;
import me.lucko.spark.common.monitor.memory.GarbageCollectionMonitor;
import me.lucko.spark.common.monitor.memory.GarbageCollectorStatistics;
import me.lucko.spark.common.util.FormatUtil;

import net.kyori.adventure.text.Component;

import java.lang.management.MemoryUsage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import me.lucko.spark.common.util.FormatUtil;
import me.lucko.spark.common.util.RollingAverage;
import me.lucko.spark.common.util.StatisticFormatter;

import net.kyori.adventure.text.Component;

import java.lang.management.ManagementFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import me.lucko.spark.common.util.FormatUtil;
import me.lucko.spark.common.util.MediaTypes;
import me.lucko.spark.proto.SparkHeapProtos;

import net.kyori.adventure.text.event.ClickEvent;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import me.lucko.spark.common.monitor.tick.ReportPredicate;
import me.lucko.spark.common.monitor.tick.TickMonitor;
import me.lucko.spark.common.tick.TickHook;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;

import me.lucko.spark.proto.SparkProtos.CommandSenderMetadata;

import net.kyori.adventure.text.Component;

import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@

package me.lucko.spark.common.heapdump;

import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
import java.nio.file.Path;

import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectName;

/**
* Utility for creating .hprof memory heap snapshots.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
import me.lucko.spark.proto.SparkHeapProtos.HeapData;
import me.lucko.spark.proto.SparkHeapProtos.HeapEntry;
import me.lucko.spark.proto.SparkHeapProtos.HeapMetadata;

import org.objectweb.asm.Type;

import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
import java.util.List;
Expand All @@ -36,10 +38,6 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectName;

/**
* Represents a "heap dump summary" from the VM.
*
Expand Down
Loading

0 comments on commit c94eba9

Please sign in to comment.