Span web Ui test success.

#351
This commit is contained in:
pengys5 2017-08-11 22:47:39 +08:00
parent 883ee2f7e5
commit 5355fc462a
1 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.List;
import org.skywalking.apm.collector.storage.dao.DAOContainer;
import org.skywalking.apm.collector.ui.cache.ServiceNameCache;
import org.skywalking.apm.collector.ui.dao.ISegmentDAO;
import org.skywalking.apm.network.proto.KeyWithStringValue;
import org.skywalking.apm.network.proto.LogMessage;
@ -23,7 +24,11 @@ public class SpanService {
List<SpanObject> spans = segmentObject.getSpansList();
for (SpanObject spanObject : spans) {
if (spanId == spanObject.getSpanId()) {
spanJson.addProperty("operationName", spanObject.getOperationName());
String operationName = spanObject.getOperationName();
if (spanObject.getOperationNameId() != 0) {
operationName = ServiceNameCache.get(spanObject.getOperationNameId());
}
spanJson.addProperty("operationName", operationName);
spanJson.addProperty("startTime", spanObject.getStartTime());
spanJson.addProperty("endTime", spanObject.getEndTime());