/** * Returns the short span details in form of StyledString. This method returns details if on of * these situations is matched: * * <ul> * <li>Propagation type is known for a span. * <li>Operation name exists as a tag. * <li>Method ident exists in the span. * </ul> * * @param span * {@link Span} * @param cachedDataService * Cached data service to load the method ident information from. * @return Returns {@link StyledString} if information in the span is enough or * <code>null</code> if details can not be constructed. */ public static StyledString getSpanDetailsShort(Span span, ICachedDataService cachedDataService) { return getSpanDetailsShort(span.getPropagationType(), span.getMethodIdent(), span.getTags(), cachedDataService); }
return TextFormatter.getSpanDetailsShort(span, cachedDataService); case PROPAGATION: return TextFormatter.getPropagationStyled(span.getPropagationType());
/** * Returns the styled text for a specific column. * * @param data * The data object to extract the information from. * @param enumId * The enumeration ID. * @return The styled string containing the information from the data object. */ private StyledString getStyledTextForColumn(Span data, Column enumId) { switch (enumId) { case TIME: return new StyledString(NumberFormatter.formatTimeWithMillis(data.getTimeStamp())); case DURATION: return new StyledString(NumberFormatter.formatDouble(data.getDuration(), timeDecimalPlaces)); case PROPAGATION: return TextFormatter.getPropagationStyled(data.getPropagationType()); case DETAILS: return TextFormatter.getSpanDetailsShort(data, cachedDataService); case ORIGIN: return TextFormatter.getSpanOriginStyled(data, cachedDataService.getPlatformIdentForId(data.getPlatformIdent())); case TRACE_ID: return new StyledString(Long.toHexString(data.getSpanIdent().getTraceId())); default: return new StyledString("error"); } } }