aboutsummaryrefslogtreecommitdiff
path: root/spark-waterdog
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-09-19 18:57:02 +0100
committerLuck <git@lucko.me>2022-09-19 20:09:01 +0100
commit7079484d428321c9b3db09394577efda4d591a4e (patch)
tree1e751e3c832d6df00c7e50357be44b85a2fd5df9 /spark-waterdog
parent7ef9b6281135ce0a24f3c14c2255d9a2c2eca969 (diff)
downloadspark-7079484d428321c9b3db09394577efda4d591a4e.tar.gz
spark-7079484d428321c9b3db09394577efda4d591a4e.tar.bz2
spark-7079484d428321c9b3db09394577efda4d591a4e.zip
Provide extra metadata about sources in sampler data
Diffstat (limited to 'spark-waterdog')
-rw-r--r--spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java2
-rw-r--r--spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java14
2 files changed, 14 insertions, 2 deletions
diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java
index 36e6a57..2207c9e 100644
--- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java
+++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogClassSourceLookup.java
@@ -20,7 +20,7 @@
package me.lucko.spark.waterdog;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import dev.waterdog.waterdogpe.ProxyServer;
import dev.waterdog.waterdogpe.plugin.Plugin;
diff --git a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
index 07b153a..1a64a98 100644
--- a/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
+++ b/spark-waterdog/src/main/java/me/lucko/spark/waterdog/WaterdogSparkPlugin.java
@@ -24,7 +24,8 @@ import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.SparkPlugin;
import me.lucko.spark.common.monitor.ping.PlayerPingProvider;
import me.lucko.spark.common.platform.PlatformInfo;
-import me.lucko.spark.common.util.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.ClassSourceLookup;
+import me.lucko.spark.common.sampler.source.SourceMetadata;
import dev.waterdog.waterdogpe.ProxyServer;
import dev.waterdog.waterdogpe.command.Command;
@@ -32,6 +33,7 @@ import dev.waterdog.waterdogpe.command.CommandSender;
import dev.waterdog.waterdogpe.plugin.Plugin;
import java.nio.file.Path;
+import java.util.Collection;
import java.util.logging.Level;
import java.util.stream.Stream;
@@ -101,6 +103,16 @@ public class WaterdogSparkPlugin extends Plugin implements SparkPlugin {
}
@Override
+ public Collection<SourceMetadata> getKnownSources() {
+ return SourceMetadata.gather(
+ getProxy().getPluginManager().getPlugins(),
+ Plugin::getName,
+ plugin -> plugin.getDescription().getVersion(),
+ plugin -> plugin.getDescription().getAuthor()
+ );
+ }
+
+ @Override
public PlayerPingProvider createPlayerPingProvider() {
return new WaterdogPlayerPingProvider(getProxy());
}