From 48924d99d3f91d7319eceea74619c5ebcf4d76fa Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 9 Jun 2018 22:47:50 +0100 Subject: Use ScheduledExecutorService instead of Timer --- .../src/main/java/me/lucko/spark/profiler/SamplerBuilder.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java') diff --git a/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java b/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java index 7db0515..733f4e3 100644 --- a/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java @@ -1,6 +1,5 @@ package me.lucko.spark.profiler; -import java.util.Timer; import java.util.concurrent.TimeUnit; /** @@ -48,7 +47,7 @@ public class SamplerBuilder { return this; } - public Sampler start(Timer samplingThread) { + public Sampler start() { Sampler sampler; if (this.ticksOver != -1 && this.tickCounter != null) { sampler = new Sampler(this.samplingInterval, this.threadDumper, this.threadGrouper, this.timeout, this.tickCounter, this.ticksOver); @@ -56,7 +55,7 @@ public class SamplerBuilder { sampler = new Sampler(this.samplingInterval, this.threadDumper, this.threadGrouper, this.timeout); } - sampler.start(samplingThread); + sampler.start(); return sampler; } -- cgit