mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[maven] add new api to maven server telemetry
GitOrigin-RevId: 5e20b4895bcdad13a86efc3a4167215ae7e280ed
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dd76c089dd
commit
0fab66f445
@@ -33,6 +33,11 @@ public interface MavenServerOpenTelemetry {
|
||||
|
||||
<T, R> List<R> execute(boolean inParallel, @NotNull Collection<T> collection, @NotNull Function<T, R> method);
|
||||
|
||||
<T, R> List<R> executeWithSpan(@NotNull String spanName,
|
||||
boolean inParallel,
|
||||
@NotNull Collection<T> collection,
|
||||
@NotNull Function<T, R> method);
|
||||
|
||||
byte[] shutdown();
|
||||
|
||||
static MavenServerOpenTelemetry of(@NotNull LongRunningTaskInput input) {
|
||||
@@ -56,6 +61,14 @@ final class MavenServerOpenTelemetryNoop implements MavenServerOpenTelemetry {
|
||||
return ParallelRunnerForServer.execute(inParallel, collection, method);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, R> List<R> executeWithSpan(@NotNull String spanName,
|
||||
boolean inParallel,
|
||||
@NotNull Collection<T> collection,
|
||||
@NotNull Function<T, R> method) {
|
||||
return execute(inParallel, collection, method);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] shutdown() {
|
||||
return ArrayUtilRt.EMPTY_BYTE_ARRAY;
|
||||
@@ -130,6 +143,16 @@ final class MavenServerOpenTelemetryImpl implements MavenServerOpenTelemetry {
|
||||
return ParallelRunnerForServer.execute(inParallel, collection, context.wrapFunction(method));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, R> List<R> executeWithSpan(@NotNull String spanName,
|
||||
boolean inParallel,
|
||||
@NotNull Collection<T> collection,
|
||||
@NotNull Function<T, R> method) {
|
||||
return callWithSpan(spanName, () ->
|
||||
execute(inParallel, collection, method)
|
||||
);
|
||||
}
|
||||
|
||||
public <T> T callWithSpan(@NotNull String spanName, @NotNull Function<Span, T> fn) {
|
||||
return callWithSpan(spanName, (ignore) -> {
|
||||
}, fn);
|
||||
|
||||
Reference in New Issue
Block a user