Skip to content

Commit 6e591f5

Browse files
committed
Add more sysprops
1 parent 4802988 commit 6e591f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/src/main/java/org/embeddedt/modernfix/spark/SparkLaunchProfiler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ public class SparkLaunchProfiler {
3838
private static final SparkPlatform platform = new SparkPlatform(new ModernFixSparkPlugin());
3939

4040
private static final boolean USE_JAVA_SAMPLER_FOR_LAUNCH = !Boolean.getBoolean("modernfix.profileWithAsyncSampler");
41+
private static final int SAMPLING_INTERVAL = Integer.getInteger("modernfix.profileSamplingIntervalMicroseconds", 4000);
42+
private static final String THREAD_GROUPER = System.getProperty("modernfix.profileSamplingThreadGrouper", "by-pool");
4143

4244
public static void start(String key) {
4345
if (!ongoingSamplers.containsKey(key)) {
4446
Sampler sampler;
45-
SamplerSettings settings = new SamplerSettings(4000, ThreadDumper.ALL, ThreadGrouper.BY_NAME, -1, false);
47+
SamplerSettings settings = new SamplerSettings(SAMPLING_INTERVAL, ThreadDumper.ALL, ThreadGrouper.parseConfigSetting(THREAD_GROUPER), -1, false);
4648
try {
4749
if(USE_JAVA_SAMPLER_FOR_LAUNCH) {
4850
throw new UnsupportedOperationException();
4951
}
50-
sampler = new AsyncSampler(platform, settings, new SampleCollector.Execution(4000));
52+
sampler = new AsyncSampler(platform, settings, new SampleCollector.Execution(SAMPLING_INTERVAL));
5153
} catch (UnsupportedOperationException e) {
5254
sampler = new JavaSampler(platform, settings, true, true);
5355
}

0 commit comments

Comments
 (0)