use of com.navercorp.pinpoint.bootstrap.plugin.test.ExpectedTrace in project pinpoint by naver.
the class AsyncEchoTestClient method verifyTraces.
@Override
public void verifyTraces(PluginTestVerifier verifier, String expectedMessage) throws Exception {
final InetSocketAddress actualServerAddress = this.environment.getServerAddress();
// ********** Asynchronous Traces
// SpanEvent - Asynchronous Invocation
ExpectedTrace asyncInvocationTrace = event("ASYNC", "Asynchronous Invocation");
// SpanEvent - TAsyncMethodCall.cleanUpAndFireCallback
Method cleanUpAndFireCallback = TAsyncMethodCall.class.getDeclaredMethod("cleanUpAndFireCallback", SelectionKey.class);
ExpectedTrace cleanUpAndFireCallbackTrace = event("THRIFT_CLIENT_INTERNAL", cleanUpAndFireCallback);
// SpanEvent - TServiceClient.receiveBase
Method receiveBase = TServiceClient.class.getDeclaredMethod("receiveBase", TBase.class, String.class);
ExpectedAnnotation thriftResult = Expectations.annotation("thrift.result", "echo_result(success:" + expectedMessage + ")");
ExpectedTrace receiveBaseTrace = event(// ServiceType
"THRIFT_CLIENT_INTERNAL", // Method
receiveBase, // Annotation("thrift.result")
thriftResult);
// ********** Root trace for Asynchronous traces
// SpanEvent - TAsyncClientManager.call
Method call = TAsyncClientManager.class.getDeclaredMethod("call", TAsyncMethodCall.class);
ExpectedAnnotation thriftUrl = Expectations.annotation("thrift.url", actualServerAddress.getHostName() + ":" + actualServerAddress.getPort() + "/com/navercorp/pinpoint/plugin/thrift/dto/EchoService/echo_call");
ExpectedTrace callTrace = event(// ServiceType
"THRIFT_CLIENT", // Method
call, // rpc
null, // endPoint
null, // destinationId
actualServerAddress.getHostName() + ":" + actualServerAddress.getPort(), // Annotation("thrift.url")
thriftUrl);
verifier.verifyTrace(async(callTrace, asyncInvocationTrace, cleanUpAndFireCallbackTrace, receiveBaseTrace));
}
Aggregations