Skip to content

Commit b1701c5

Browse files
committed
Format code
1 parent 7ae393e commit b1701c5

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.JfrReader;
99
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.StackTrace;
1010
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.event.Event;
11-
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.event.EventAggregator;
1211
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.event.EventCollector;
1312
import io.sentry.protocol.SentryStackFrame;
1413
import io.sentry.protocol.profiling.SentryProfile;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.event.Event;
44
import io.sentry.asyncprofiler.vendor.asyncprofiler.jfr.event.EventCollector;
5-
65
import java.util.ArrayList;
76
import java.util.List;
87

@@ -31,8 +30,8 @@ public boolean finish() {
3130

3231
@Override
3332
public void forEach(Visitor visitor) {
34-
for (Event event : events) {
35-
visitor.visit(event, event.samples(), event.value());
36-
}
33+
for (Event event : events) {
34+
visitor.visit(event, event.samples(), event.value());
35+
}
3736
}
3837
}

sentry-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ private void start() {
222222
String.format("%dus", (int) SECONDS.toMicros(1) / profilingTracesHz);
223223
// Example command: start,jfr,event=wall,interval=9900us,file=/path/to/trace.jfr
224224
final String command =
225-
String.format("start,jfr,event=wall,interval=%s,file=%s", profilingIntervalMicros, filename);
225+
String.format(
226+
"start,jfr,event=wall,interval=%s,file=%s", profilingIntervalMicros, filename);
226227

227228
profiler.execute(command);
228229

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ class JfrAsyncProfilerToSentryProfileConverterTest {
9494
val sentryProfile = fixture.getSut()!!.convertFromFile(file)
9595
val tracingFilterFrame =
9696
sentryProfile.frames.filter {
97-
it.function == "slowFunction" &&
98-
it.module == "io.sentry.samples.console.Main"
97+
it.function == "slowFunction" && it.module == "io.sentry.samples.console.Main"
9998
}
10099

101100
val tracingFilterFrameIndexes = tracingFilterFrame.map { sentryProfile.frames.indexOf(it) }
@@ -107,21 +106,28 @@ class JfrAsyncProfilerToSentryProfileConverterTest {
107106

108107
// Sample size base on 101 samples/sec and 10 sec of profiling
109108
// 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()}")
109+
assertTrue(
110+
tracingFilterSamples.count() >= 1000 && tracingFilterSamples.count() <= 1120,
111+
"Expected sample count between 1000 and 1120, but was ${tracingFilterSamples.count()}",
112+
)
111113
}
112114

113115
@Test
114116
fun `check number of samples for specific thread`() {
115117
val file = Path(loadFile("async_profiler_test_sample.jfr"))
116118

117119
val sentryProfile = fixture.getSut()!!.convertFromFile(file)
118-
val mainThread = sentryProfile.threadMetadata.entries.firstOrNull { it.value.name == "main" }?.key
120+
val mainThread =
121+
sentryProfile.threadMetadata.entries.firstOrNull { it.value.name == "main" }?.key
119122

120123
val samples = sentryProfile.samples.filter { it.threadId == mainThread }
121124

122125
// Sample size base on 101 samples/sec and 10 sec of profiling
123126
// 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()}")
127+
assertTrue(
128+
samples.count() >= 1000 && samples.count() <= 1120,
129+
"Expected sample count between 1000 and 1120, but was ${samples.count()}",
130+
)
125131
}
126132

127133
@Test

0 commit comments

Comments
 (0)