public Sampler() { this(10, 3600000, (t) -> new FastStackCollector(false, true, new Thread[]{t})); }
public FastStackCollector(final boolean collectRunnableThreadsOnly, final boolean collectForMain, final Thread[] ignored, final String... xtraIgnoredThreads) { this(createNameBasedFilter(collectRunnableThreadsOnly, collectForMain, ignored, xtraIgnoredThreads), DEFAULT_MAX_NR_SAMPLED_THREADS); }
public Sampler(final int sampleTimeMillis) { this(sampleTimeMillis, 3600000, (t) -> new FastStackCollector(false, true, new Thread[]{t})); }
@SuppressFBWarnings("PATH_TRAVERSAL_IN") public Sampler(final int sampleTimeMillis, final int dumpTimeMillis) { this(sampleTimeMillis, dumpTimeMillis, (t) -> new FastStackCollector(false, true, new Thread[]{t}), DEFAULT_SS_DUMP_FOLDER, DEFAULT_SS_DUMP_FILE_NAME_PREFIX); }
public Spf4jRunListener() { sampler = new Sampler(Integer.getInteger("spf4j.junit.sampleTimeMillis", 5), Integer.getInteger("spf4j.junit.dumpAfterMillis", Integer.MAX_VALUE), (t) -> new FastStackCollector(false, true, new Thread[] {t})); destinationFolder = new File(System.getProperty("spf4j.junit.destinationFolder", "target/junit-ssdump")); if (!destinationFolder.mkdirs() && !destinationFolder.canWrite()) { throw new ExceptionInInitializerError("Unable to write to " + destinationFolder); } }
public static synchronized Sampler getSampler(final int sampleTimeMillis, final int dumpTimeMillis, final File dumpFolder, final String dumpFilePrefix) throws InterruptedException { return getSampler(sampleTimeMillis, dumpTimeMillis, (t) -> new FastStackCollector(false, true, new Thread[]{t}), dumpFolder, dumpFilePrefix); }
(t) -> new FastStackCollector(false, true, new Thread[]{t}), options.dumpFolder, options.dumpFilePrefix); Runtime.getRuntime().addShutdownHook(new Thread(new AbstractRunnable() {