Skip to content

Commit 9358d52

Browse files
committed
Use ConfigProperties method 'getDuration' when looking for the snapshot profiling sampling interval.
1 parent b6f6055 commit 9358d52

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

profiler/src/main/java/com/splunk/opentelemetry/profiler/Configuration.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,8 @@ public static int getSnapshotProfilerStackDepth(ConfigProperties properties) {
224224
}
225225

226226
public static Duration getSnapshotProfilerSamplingInterval(ConfigProperties properties) {
227-
int millis = properties.getInt(CONFIG_KEY_SNAPSHOT_PROFILER_SAMPLING_INTERVAL, 0);
228-
if (millis > 0) {
229-
return Duration.ofMillis(millis);
230-
}
231-
return DEFAULT_SNAPSHOT_PROFILER_SAMPLING_INTERVAL;
227+
return properties.getDuration(
228+
CONFIG_KEY_SNAPSHOT_PROFILER_SAMPLING_INTERVAL,
229+
DEFAULT_SNAPSHOT_PROFILER_SAMPLING_INTERVAL);
232230
}
233231
}

0 commit comments

Comments
 (0)