MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / basicProcessSampling

Method basicProcessSampling

test/test/proc/ProcTests.java:19–32  ·  view source on GitHub ↗
(TestProcess p)

Source from the content-addressed store, hash-verified

17public class ProcTests {
18
19 @Test(mainClass = BasicApp.class, os = Os.LINUX)
20 public void basicProcessSampling(TestProcess p) throws Exception {
21 p.profile("--proc 1 -d 3 -f %f.jfr");
22 try (JfrReader jfr = new JfrReader(p.getFilePath("%f"))) {
23 List<ProcessSample> events = jfr.readAllEvents(ProcessSample.class);
24 assert !events.isEmpty();
25
26 List<ProcessSample> appSamples = events.stream()
27 .filter(e -> e.cmdLine != null && e.cmdLine.contains("BasicApp"))
28 .collect(Collectors.toList());
29
30 Assert.isEqual(appSamples.size(), 2); // We discard the first sample
31 }
32 }
33
34// TODO(issue-1432): Re-enable after tiered integration tests are supported.
35// @Test(mainClass = BasicApp.class, os = Os.LINUX)

Callers

nothing calls this directly

Calls 9

isEqualMethod · 0.95
profileMethod · 0.80
readAllEventsMethod · 0.80
filterMethod · 0.80
streamMethod · 0.80
collectMethod · 0.65
getFilePathMethod · 0.45
containsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected