Skip to content

Commit 524a32a

Browse files
committed
fix duplication of events
1 parent 94a37b1 commit 524a32a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sentry-async-profiler/src/main/java/io/sentry/asyncprofiler/convert/NonAggregatingEventCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void afterChunk() {
2525

2626
@Override
2727
public boolean finish() {
28-
return true;
28+
return false;
2929
}
3030

3131
@Override

sentry-async-profiler/src/test/java/io/sentry/asyncprofiler/convert/JfrAsyncProfilerToSentryProfileConverterTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ class JfrAsyncProfilerToSentryProfileConverterTest {
104104
val tracingFilterSamples =
105105
sentryProfile.samples.filter { tracingFilterStackIds.contains(it.stackId) }
106106

107-
// Sample size base on 101 samples/sec and 10 sec of profiling
108-
// So expected around 1010 samples (with some margin)
107+
// Sample size base on 101 samples/sec and 5 sec of profiling
108+
// So expected around 500 samples (with some margin)
109109
assertTrue(
110-
tracingFilterSamples.count() >= 1000 && tracingFilterSamples.count() <= 1120,
111-
"Expected sample count between 1000 and 1120, but was ${tracingFilterSamples.count()}",
110+
tracingFilterSamples.count() >= 500 && tracingFilterSamples.count() <= 600,
111+
"Expected sample count between 500 and 600, but was ${tracingFilterSamples.count()}",
112112
)
113113
}
114114

@@ -122,11 +122,11 @@ class JfrAsyncProfilerToSentryProfileConverterTest {
122122

123123
val samples = sentryProfile.samples.filter { it.threadId == mainThread }
124124

125-
// Sample size base on 101 samples/sec and 10 sec of profiling
126-
// So expected around 1010 samples (with some margin)
125+
// Sample size base on 101 samples/sec and 5 sec of profiling
126+
// So expected around 500 samples (with some margin)
127127
assertTrue(
128-
samples.count() >= 1000 && samples.count() <= 1120,
129-
"Expected sample count between 1000 and 1120, but was ${samples.count()}",
128+
samples.count() >= 500 && samples.count() <= 600,
129+
"Expected sample count between 500 and 600, but was ${samples.count()}",
130130
)
131131
}
132132

0 commit comments

Comments
 (0)