You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sentry-async-profiler/src/test/java/io/sentry/asyncprofiler/convert/JfrAsyncProfilerToSentryProfileConverterTest.kt
// Sample Size 22 taken from intellij profiler with the JFR file
116
-
assertEquals(22, tracingFilterSamples.size)
108
+
// Sample size base on 101 samples/sec and 10 sec of profiling
109
+
// So expected around 1010 samples (with some margin)
110
+
assertTrue(tracingFilterSamples.count() >=1000&& tracingFilterSamples.count() <=1120, "Expected sample count between 1000 and 1120, but was ${tracingFilterSamples.count()}")
111
+
}
112
+
113
+
@Test
114
+
fun`check number of samples for specific thread`() {
115
+
val file =Path(loadFile("async_profiler_test_sample.jfr"))
116
+
117
+
val sentryProfile = fixture.getSut()!!.convertFromFile(file)
118
+
val mainThread = sentryProfile.threadMetadata.entries.firstOrNull { it.value.name =="main" }?.key
119
+
120
+
val samples = sentryProfile.samples.filter { it.threadId == mainThread }
121
+
122
+
// Sample size base on 101 samples/sec and 10 sec of profiling
123
+
// So expected around 1010 samples (with some margin)
124
+
assertTrue(samples.count() >=1000&& samples.count() <=1120, "Expected sample count between 1000 and 1120, but was ${samples.count()}")
117
125
}
118
126
119
127
@Test
@@ -202,7 +210,10 @@ class JfrAsyncProfilerToSentryProfileConverterTest {
0 commit comments