diff options
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java b/spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java index 2936c65..07449ec 100644 --- a/spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java +++ b/spark-common/src/main/java/me/lucko/spark/sampler/SamplerBuilder.java @@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit; public class SamplerBuilder { private int samplingInterval = 4; + private boolean includeLineNumbers = false; private long timeout = -1; private ThreadDumper threadDumper = ThreadDumper.ALL; private ThreadGrouper threadGrouper = ThreadGrouper.BY_NAME; @@ -67,12 +68,17 @@ public class SamplerBuilder { return this; } + public SamplerBuilder includeLineNumbers(boolean includeLineNumbers) { + this.includeLineNumbers = includeLineNumbers; + return this; + } + 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); + sampler = new Sampler(this.samplingInterval, this.threadDumper, this.threadGrouper, this.timeout, this.includeLineNumbers, this.tickCounter, this.ticksOver); } else { - sampler = new Sampler(this.samplingInterval, this.threadDumper, this.threadGrouper, this.timeout); + sampler = new Sampler(this.samplingInterval, this.threadDumper, this.threadGrouper, this.timeout, this.includeLineNumbers); } sampler.start(); |