use of com.navercorp.pinpoint.common.trace.LoggingInfo in project pinpoint by naver.
the class PluginVerifierExternalAdaptor method verifyIsLoggingTransactionInfo.
@Override
public void verifyIsLoggingTransactionInfo(LoggingInfo loggingInfo) {
final Item<SpanType> item = popItem();
if (item == null) {
throw new AssertionError("Expected a Span isLoggingTransactionInfo value with [" + loggingInfo.getName() + "]" + " but loggingTransactionInfo value invalid.");
}
final TraceRoot traceRoot = item.getTraceRoot();
final byte loggingTransactionInfo = traceRoot.getShared().getLoggingInfo();
if (loggingTransactionInfo != loggingInfo.getCode()) {
LoggingInfo code = LoggingInfo.searchByCode(loggingTransactionInfo);
String codeName = getCodeName(code);
AssertionErrorBuilder builder = new AssertionErrorBuilder("Span.isLoggingTransactionInfo value", loggingInfo.getName(), codeName);
builder.setComparison(loggingInfo.getName(), codeName);
builder.throwAssertionError();
}
}
use of com.navercorp.pinpoint.common.trace.LoggingInfo in project pinpoint by naver.
the class PluginTestAgent method verifyIsLoggingTransactionInfo.
@Override
public void verifyIsLoggingTransactionInfo(LoggingInfo loggingInfo) {
Object actual = popSpan();
Span span = null;
if (actual instanceof Span) {
span = (Span) actual;
} else if (actual instanceof SpanEvent) {
span = ((SpanEvent) actual).getSpan();
} else {
throw new IllegalArgumentException("Unexpected type: " + getActual(actual));
}
if (span.getLoggingTransactionInfo() != loggingInfo.getCode()) {
LoggingInfo loggingTransactionInfo = LoggingInfo.searchByCode(span.getLoggingTransactionInfo());
if (loggingTransactionInfo != null) {
throw new AssertionError("Expected a Span isLoggingTransactionInfo value with [" + loggingInfo.getName() + "] but was [" + loggingTransactionInfo.getName() + "]. expected: " + loggingInfo.getName() + ", was: " + loggingTransactionInfo.getName());
} else {
throw new AssertionError("Expected a Span isLoggingTransactionInfo value with [" + loggingInfo.getName() + "] but loggingTransactionInfo value invalid.");
}
}
}
Aggregations