mirror of https://github.com/grpc/grpc-java.git
core: remove scopeid overloads of perfmark
This commit is contained in:
parent
ea70de601c
commit
4b2e60a06b
|
|
@ -183,12 +183,11 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Listener<RespT> observer, Metadata headers) {
|
public void start(Listener<RespT> observer, Metadata headers) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.start");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ClientCall.start");
|
|
||||||
try {
|
try {
|
||||||
startInternal(observer, headers);
|
startInternal(observer, headers);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -386,12 +385,11 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(@Nullable String message, @Nullable Throwable cause) {
|
public void cancel(@Nullable String message, @Nullable Throwable cause) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.cancel");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ClientCall.cancel");
|
|
||||||
try {
|
try {
|
||||||
cancelInternal(message, cause);
|
cancelInternal(message, cause);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -426,12 +424,11 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void halfClose() {
|
public void halfClose() {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.halfClose");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ClientCall.halfClose");
|
|
||||||
try {
|
try {
|
||||||
halfCloseInternal();
|
halfCloseInternal();
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -445,12 +442,11 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessage(ReqT message) {
|
public void sendMessage(ReqT message) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.sendMessage");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ClientCall.sendMessage");
|
|
||||||
try {
|
try {
|
||||||
sendMessageInternal(message);
|
sendMessageInternal(message);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -512,7 +508,6 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
private class ClientStreamListenerImpl implements ClientStreamListener {
|
private class ClientStreamListenerImpl implements ClientStreamListener {
|
||||||
private final Listener<RespT> observer;
|
private final Listener<RespT> observer;
|
||||||
private boolean closed;
|
private boolean closed;
|
||||||
private final long listenerScopeId = PerfTag.allocateNumericId();
|
|
||||||
|
|
||||||
public ClientStreamListenerImpl(Listener<RespT> observer) {
|
public ClientStreamListenerImpl(Listener<RespT> observer) {
|
||||||
this.observer = checkNotNull(observer, "observer");
|
this.observer = checkNotNull(observer, "observer");
|
||||||
|
|
@ -530,8 +525,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
if (closed) {
|
if (closed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.headersRead");
|
||||||
listenerScopeId, Thread.currentThread().getName(), tag, "ClientCall.headersRead");
|
|
||||||
try {
|
try {
|
||||||
observer.onHeaders(headers);
|
observer.onHeaders(headers);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
@ -540,7 +534,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
stream.cancel(status);
|
stream.cancel(status);
|
||||||
close(status, new Metadata());
|
close(status, new Metadata());
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -561,11 +555,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
GrpcUtil.closeQuietly(producer);
|
GrpcUtil.closeQuietly(producer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.messagesAvailable");
|
||||||
listenerScopeId,
|
|
||||||
Thread.currentThread().getName(),
|
|
||||||
tag,
|
|
||||||
"ClientCall.messagesAvailable");
|
|
||||||
try {
|
try {
|
||||||
InputStream message;
|
InputStream message;
|
||||||
while ((message = producer.next()) != null) {
|
while ((message = producer.next()) != null) {
|
||||||
|
|
@ -584,7 +574,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
stream.cancel(status);
|
stream.cancel(status);
|
||||||
close(status, new Metadata());
|
close(status, new Metadata());
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -637,12 +627,11 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
// We intentionally don't keep the status or metadata from the server.
|
// We intentionally don't keep the status or metadata from the server.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.closed");
|
||||||
listenerScopeId, Thread.currentThread().getName(), tag, "ClientCall.closed");
|
|
||||||
try {
|
try {
|
||||||
close(savedStatus, savedTrailers);
|
close(savedStatus, savedTrailers);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -659,8 +648,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void runInContext() {
|
public final void runInContext() {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ClientCall.onReady");
|
||||||
listenerScopeId, Thread.currentThread().getName(), tag, "ClientCall.onReady");
|
|
||||||
try {
|
try {
|
||||||
observer.onReady();
|
observer.onReady();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
@ -669,7 +657,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
||||||
stream.cancel(status);
|
stream.cancel(status);
|
||||||
close(status, new Metadata());
|
close(status, new Metadata());
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,11 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendHeaders(Metadata headers) {
|
public void sendHeaders(Metadata headers) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ServerCall.sendHeaders");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ServerCall.sendHeaders");
|
|
||||||
try {
|
try {
|
||||||
sendHeadersInternal(headers);
|
sendHeadersInternal(headers);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,12 +139,11 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMessage(RespT message) {
|
public void sendMessage(RespT message) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ServerCall.sendMessage");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ServerCall.sendMessage");
|
|
||||||
try {
|
try {
|
||||||
sendMessageInternal(message);
|
sendMessageInternal(message);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,12 +192,11 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close(Status status, Metadata trailers) {
|
public void close(Status status, Metadata trailers) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(tag, "ServerCall.close");
|
||||||
tag.getNumericTag(), Thread.currentThread().getName(), tag, "ServerCall.close");
|
|
||||||
try {
|
try {
|
||||||
closeInternal(status, trailers);
|
closeInternal(status, trailers);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(tag.getNumericTag(), Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -263,7 +260,6 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
private final ServerCallImpl<ReqT, ?> call;
|
private final ServerCallImpl<ReqT, ?> call;
|
||||||
private final ServerCall.Listener<ReqT> listener;
|
private final ServerCall.Listener<ReqT> listener;
|
||||||
private final Context.CancellableContext context;
|
private final Context.CancellableContext context;
|
||||||
private final long listenerScopeId = PerfTag.allocateNumericId();
|
|
||||||
|
|
||||||
public ServerStreamListenerImpl(
|
public ServerStreamListenerImpl(
|
||||||
ServerCallImpl<ReqT, ?> call, ServerCall.Listener<ReqT> listener,
|
ServerCallImpl<ReqT, ?> call, ServerCall.Listener<ReqT> listener,
|
||||||
|
|
@ -292,11 +288,7 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(call.tag, "ServerCall.messagesAvailable");
|
||||||
listenerScopeId,
|
|
||||||
Thread.currentThread().getName(),
|
|
||||||
call.tag,
|
|
||||||
"ServerCall.messagesAvailable");
|
|
||||||
InputStream message;
|
InputStream message;
|
||||||
try {
|
try {
|
||||||
while ((message = producer.next()) != null) {
|
while ((message = producer.next()) != null) {
|
||||||
|
|
@ -313,7 +305,7 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
MoreThrowables.throwIfUnchecked(t);
|
MoreThrowables.throwIfUnchecked(t);
|
||||||
throw new RuntimeException(t);
|
throw new RuntimeException(t);
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,26 +315,18 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(call.tag, "ServerCall.halfClosed");
|
||||||
listenerScopeId,
|
|
||||||
Thread.currentThread().getName(),
|
|
||||||
call.tag,
|
|
||||||
"ServerCall.halfClosed");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
listener.onHalfClose();
|
listener.onHalfClose();
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closed(Status status) {
|
public void closed(Status status) {
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(call.tag, "ServerCall.closed");
|
||||||
listenerScopeId,
|
|
||||||
Thread.currentThread().getName(),
|
|
||||||
call.tag,
|
|
||||||
"ServerCall.closed");
|
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
if (status.isOk()) {
|
if (status.isOk()) {
|
||||||
|
|
@ -358,7 +342,7 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,15 +351,11 @@ final class ServerCallImpl<ReqT, RespT> extends ServerCall<ReqT, RespT> {
|
||||||
if (call.cancelled) {
|
if (call.cancelled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PerfMark.taskStart(
|
PerfMark.taskStart(call.tag, "ServerCall.closed");
|
||||||
listenerScopeId,
|
|
||||||
Thread.currentThread().getName(),
|
|
||||||
call.tag,
|
|
||||||
"ServerCall.closed");
|
|
||||||
try {
|
try {
|
||||||
listener.onReady();
|
listener.onReady();
|
||||||
} finally {
|
} finally {
|
||||||
PerfMark.taskEnd(listenerScopeId, Thread.currentThread().getName());
|
PerfMark.taskEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,23 +42,6 @@ public final class PerfMark {
|
||||||
*/
|
*/
|
||||||
public static void taskStart(PerfTag tag, @CompileTimeConstant String taskName) {}
|
public static void taskStart(PerfTag tag, @CompileTimeConstant String taskName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with a Tag to identify it; a task represents some work that spans some time, and
|
|
||||||
* you are interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* #taskStart(String)} or {@link PerfTag#create(String)}.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static void taskStart(
|
|
||||||
long scopeId, String scopeName, PerfTag tag, @CompileTimeConstant String taskName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task; a task represents some work that spans some time, and you are interested in both
|
* Start a Task; a task represents some work that spans some time, and you are interested in both
|
||||||
* its start time and end time.
|
* its start time and end time.
|
||||||
|
|
@ -68,19 +51,6 @@ public final class PerfMark {
|
||||||
*/
|
*/
|
||||||
public static void taskStart(@CompileTimeConstant String taskName) {}
|
public static void taskStart(@CompileTimeConstant String taskName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task; a task represents some work that spans some time, and you are interested in both
|
|
||||||
* its start time and end time.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static void taskStart(
|
|
||||||
long scopeId, String scopeName, @CompileTimeConstant String taskName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task with a Tag to identify it and with a time threshold; a task represents some work
|
* Start a Task with a Tag to identify it and with a time threshold; a task represents some work
|
||||||
* that spans some time, and you are interested in both its start time and end time.
|
* that spans some time, and you are interested in both its start time and end time.
|
||||||
|
|
@ -101,33 +71,6 @@ public final class PerfMark {
|
||||||
public static void taskStartWithMinPeriod(
|
public static void taskStartWithMinPeriod(
|
||||||
PerfTag tag, long minPeriodNanos, @CompileTimeConstant String taskName) {}
|
PerfTag tag, long minPeriodNanos, @CompileTimeConstant String taskName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with a Tag to identify it and with a time threshold; a task represents some work
|
|
||||||
* that spans some time, and you are interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Sometimes, you may be interested in only events that take more than a certain time
|
|
||||||
* threshold. In such cases, you can use this method. A Task that takes less than the specified
|
|
||||||
* threshold, along with all its sub-tasks, events, and additional tags will be discarded.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* #taskStartWithMinPeriod(long, String)} or {@link PerfTag#create(String)}.
|
|
||||||
* @param minPeriodNanos Tasks that takes less than the specified time period, in nanosecond, will
|
|
||||||
* be discarded, along with its sub-tasks, events, and additional tags.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static void taskStartWithMinPeriod(
|
|
||||||
long scopeId,
|
|
||||||
String scopeName,
|
|
||||||
PerfTag tag,
|
|
||||||
long minPeriodNanos,
|
|
||||||
@CompileTimeConstant String taskName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task with time threshold. A task represents some work that spans some time, and you are
|
* Start a Task with time threshold. A task represents some work that spans some time, and you are
|
||||||
* interested in both its start time and end time.
|
* interested in both its start time and end time.
|
||||||
|
|
@ -144,37 +87,9 @@ public final class PerfMark {
|
||||||
public static void taskStartWithMinPeriod(
|
public static void taskStartWithMinPeriod(
|
||||||
long minPeriodNanos, @CompileTimeConstant String taskName) {}
|
long minPeriodNanos, @CompileTimeConstant String taskName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with time threshold. A task represents some work that spans some time, and you are
|
|
||||||
* interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Sometimes, you may be interested in only events that take more than a certain time
|
|
||||||
* threshold. In such cases, you can use this method. A task that takes less than the specified
|
|
||||||
* threshold, along with all its sub-tasks, events, and additional tags will be discarded.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param minPeriodNanos Tasks that takes less than the specified time period, in nanosecond, will
|
|
||||||
* be discarded, along with its sub-tasks, events, and additional tags.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static void taskStartWithMinPeriod(
|
|
||||||
long scopeId, String scopeName, long minPeriodNanos, @CompileTimeConstant String taskName) {}
|
|
||||||
|
|
||||||
/** End a Task. See {@link #taskStart(PerfTag, String)}. */
|
/** End a Task. See {@link #taskStart(PerfTag, String)}. */
|
||||||
public static void taskEnd() {}
|
public static void taskEnd() {}
|
||||||
|
|
||||||
/**
|
|
||||||
* End a Task. See {@link #taskStart(PerfTag, String)}.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
*/
|
|
||||||
public static void taskEnd(long scopeId, String scopeName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task with a Tag to identify it in a try-with-resource statement; a task represents some
|
* Start a Task with a Tag to identify it in a try-with-resource statement; a task represents some
|
||||||
* work that spans some time, and you are interested in both its start time and end time.
|
* work that spans some time, and you are interested in both its start time and end time.
|
||||||
|
|
@ -192,27 +107,6 @@ public final class PerfMark {
|
||||||
return AUTO_DO_NOTHING;
|
return AUTO_DO_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with a Tag to identify it in a try-with-resource statement; a task represents some
|
|
||||||
* work that spans some time, and you are interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Use this in a try-with-resource statement so that task will end automatically.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* #task(String)} or {@link PerfTag#create(String)}.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static PerfMarkTask task(
|
|
||||||
long scopeId, String scopeName, PerfTag tag, @CompileTimeConstant String taskName) {
|
|
||||||
return AUTO_DO_NOTHING;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task it in a try-with-resource statement; a task represents some work that spans some
|
* Start a Task it in a try-with-resource statement; a task represents some work that spans some
|
||||||
* time, and you are interested in both its start time and end time.
|
* time, and you are interested in both its start time and end time.
|
||||||
|
|
@ -226,23 +120,6 @@ public final class PerfMark {
|
||||||
return AUTO_DO_NOTHING;
|
return AUTO_DO_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task it in a try-with-resource statement; a task represents some work that spans some
|
|
||||||
* time, and you are interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Use this in a try-with-resource statement so that task will end automatically.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static PerfMarkTask task(
|
|
||||||
long scopeId, String scopeName, @CompileTimeConstant String taskName) {
|
|
||||||
return AUTO_DO_NOTHING;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task with a Tag to identify it, and with time threshold, in a try-with-resource
|
* Start a Task with a Tag to identify it, and with time threshold, in a try-with-resource
|
||||||
* statement; a task represents some work that spans some time, and you are interested in both its
|
* statement; a task represents some work that spans some time, and you are interested in both its
|
||||||
|
|
@ -268,38 +145,6 @@ public final class PerfMark {
|
||||||
return AUTO_DO_NOTHING;
|
return AUTO_DO_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with a Tag to identify it, and with time threshold, in a try-with-resource
|
|
||||||
* statement; a task represents some work that spans some time, and you are interested in both its
|
|
||||||
* start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Use this in a try-with-resource statement so that task will end automatically.
|
|
||||||
*
|
|
||||||
* <p>Sometimes, you may be interested in only events that take more than a certain time
|
|
||||||
* threshold. In such cases, you can use this method. A task that takes less than the specified
|
|
||||||
* threshold, along with all its sub-tasks, events, and additional tags will be discarded.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* #taskWithMinPeriod(long, String)} or {@link PerfTag#create(String)}.
|
|
||||||
* @param minPeriodNanos Tasks that takes less than the specified time period, in nanosecond, will
|
|
||||||
* be discarded, along with its sub-tasks, events, and additional tags.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static PerfMarkTask taskWithMinPeriod(
|
|
||||||
long scopeId,
|
|
||||||
String scopeName,
|
|
||||||
PerfTag tag,
|
|
||||||
long minPeriodNanos,
|
|
||||||
@CompileTimeConstant String taskName) {
|
|
||||||
return AUTO_DO_NOTHING;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a Task with time threshold in a try-with-resource statement; a task represents some work
|
* Start a Task with time threshold in a try-with-resource statement; a task represents some work
|
||||||
* that spans some time, and you are interested in both its start time and end time.
|
* that spans some time, and you are interested in both its start time and end time.
|
||||||
|
|
@ -320,29 +165,6 @@ public final class PerfMark {
|
||||||
return AUTO_DO_NOTHING;
|
return AUTO_DO_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a Task with time threshold in a try-with-resource statement; a task represents some work
|
|
||||||
* that spans some time, and you are interested in both its start time and end time.
|
|
||||||
*
|
|
||||||
* <p>Use this in a try-with-resource statement so that task will end automatically.
|
|
||||||
*
|
|
||||||
* <p>Sometimes, you may be interested in only events that take more than a certain time
|
|
||||||
* threshold. In such cases, you can use this method. A task that takes less than the specified
|
|
||||||
* threshold, along with all its sub-tasks, events, and additional tags will be discarded.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the task. The scope id is used to join task starting and ending
|
|
||||||
* across threads. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param minPeriodNanos Tasks that takes less than the specified time period, in nanosecond, will
|
|
||||||
* be discarded, along with its sub-tasks, events, and additional tags.
|
|
||||||
* @param taskName The name of the task. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this task.
|
|
||||||
*/
|
|
||||||
public static PerfMarkTask taskWithMinPeriod(
|
|
||||||
long scopeId, String scopeName, long minPeriodNanos, @CompileTimeConstant String taskName) {
|
|
||||||
return AUTO_DO_NOTHING;
|
|
||||||
}
|
|
||||||
|
|
||||||
static final PerfMarkTask AUTO_DO_NOTHING = new PerfMarkTask() {
|
static final PerfMarkTask AUTO_DO_NOTHING = new PerfMarkTask() {
|
||||||
@Override
|
@Override
|
||||||
public void close() {}
|
public void close() {}
|
||||||
|
|
@ -363,25 +185,6 @@ public final class PerfMark {
|
||||||
*/
|
*/
|
||||||
public static void event(PerfTag tag, @CompileTimeConstant String eventName) {}
|
public static void event(PerfTag tag, @CompileTimeConstant String eventName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Records an Event with a Tag to identify it.
|
|
||||||
*
|
|
||||||
* <p>An Event is different from a Task in that you don't care how much time it spanned. You are
|
|
||||||
* interested in only the time it happened.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the event. The scope id is used to associated the event with a
|
|
||||||
* particular scope. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* #event(String)} or {@link PerfTag#create(String)}.
|
|
||||||
* @param eventName The name of the event. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this event.
|
|
||||||
*/
|
|
||||||
public static void event(
|
|
||||||
long scopeId, String scopeName, PerfTag tag, @CompileTimeConstant String eventName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records an Event.
|
* Records an Event.
|
||||||
*
|
*
|
||||||
|
|
@ -393,20 +196,6 @@ public final class PerfMark {
|
||||||
*/
|
*/
|
||||||
public static void event(@CompileTimeConstant String eventName) {}
|
public static void event(@CompileTimeConstant String eventName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Records an Event.
|
|
||||||
*
|
|
||||||
* <p>An Event is different from a Task in that you don't care how much time it spanned. You are
|
|
||||||
* interested in only the time it happened.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the event. The scope id is used to associate the event with a
|
|
||||||
* particular scope. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param eventName The name of the event. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this event.
|
|
||||||
*/
|
|
||||||
public static void event(long scopeId, String scopeName, @CompileTimeConstant String eventName) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an additional tag to the last task that was started.
|
* Add an additional tag to the last task that was started.
|
||||||
*
|
*
|
||||||
|
|
@ -422,24 +211,4 @@ public final class PerfMark {
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this tag.
|
* Otherwise, instrumentation result will show "(invalid name)" for this tag.
|
||||||
*/
|
*/
|
||||||
public static void tag(PerfTag tag, @CompileTimeConstant String tagName) {}
|
public static void tag(PerfTag tag, @CompileTimeConstant String tagName) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add an additional tag to the last task that was started.
|
|
||||||
*
|
|
||||||
* <p>A tag is different from an Event or a task in that clients don't care about the time at
|
|
||||||
* which this tag is added. Instead, it allows clients to associate an additional tag to the
|
|
||||||
* current Task.
|
|
||||||
*
|
|
||||||
* @param scopeId The scope of the tag. The scope id is used to associate a tag with a particular
|
|
||||||
* scope. The scope id must be a positive number.
|
|
||||||
* @param scopeName The name of the scope.
|
|
||||||
* @param tag a Tag object associated with the task. See {@link PerfTag} for description. Don't
|
|
||||||
* use 0 for the {@code numericTag} of the Tag object. 0 is reserved to represent that a task
|
|
||||||
* does not have a numeric tag associated. In this case, you are encouraged to use {@link
|
|
||||||
* PerfTag#create(String)}.
|
|
||||||
* @param tagName The name of the tag. <b>This parameter must be a compile-time constant!</b>
|
|
||||||
* Otherwise, instrumentation result will show "(invalid name)" for this tag.
|
|
||||||
*/
|
|
||||||
public static void tag(
|
|
||||||
long scopeId, String scopeName, PerfTag tag, @CompileTimeConstant String tagName) {}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue