Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ public static boolean isEnabled() {
*
* @param interval the new profiler interval
*/
public static void setProfilerInterval(Duration interval) {
@Nullable
public static Duration setProfilerInterval(Duration interval) {
InferredSpansProcessor p = instance;
if (p != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I prefer this flipped, but not a huge deal.

p.setProfilerInterval(interval);
return p.setProfilerInterval(interval);
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public class InferredSpansProcessor implements SpanProcessor {
}
}

public void setProfilerInterval(Duration interval) {
config.setProfilerInterval(interval);
public Duration setProfilerInterval(Duration interval) {
Duration oldInterval = config.setProfilerInterval(interval);
profiler.reschedule();
return oldInterval;
}

public static InferredSpansProcessorBuilder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ public Duration getProfilingInterval() {
return profilerInterval;
}

public void setProfilerInterval(Duration profilerInterval) {
public Duration setProfilerInterval(Duration profilerInterval) {
Duration oldInterval = this.profilerInterval;
this.profilerInterval = profilerInterval;
return oldInterval;
}

public Duration getProfilingDuration() {
Expand Down