aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/sampler
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-12-10 09:54:20 +0000
committerLuck <git@lucko.me>2022-12-10 09:54:20 +0000
commit1536537473aa5dead4c7353444e217df30d2ad96 (patch)
tree9d2c83fe1285f843ce8145d92fa2f037b86828ac /spark-common/src/main/java/me/lucko/spark/common/sampler
parent81326e7bd3b038c2e47cc418262fa4caaad50b48 (diff)
downloadspark-1536537473aa5dead4c7353444e217df30d2ad96.tar.gz
spark-1536537473aa5dead4c7353444e217df30d2ad96.tar.bz2
spark-1536537473aa5dead4c7353444e217df30d2ad96.zip
Never run the background profiler on MC clients
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/sampler')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java
index d655739..7e3b6b4 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java
@@ -41,10 +41,9 @@ public class BackgroundSamplerManager {
public BackgroundSamplerManager(SparkPlatform platform, Configuration configuration) {
this.platform = platform;
this.configuration = configuration;
- this.enabled = this.configuration.getBoolean(
- OPTION_ENABLED,
- this.platform.getPlugin().getPlatformInfo().getType() == PlatformInfo.Type.SERVER
- );
+
+ PlatformInfo.Type type = this.platform.getPlugin().getPlatformInfo().getType();
+ this.enabled = type != PlatformInfo.Type.CLIENT && this.configuration.getBoolean(OPTION_ENABLED, type == PlatformInfo.Type.SERVER);
}
public void initialise() {