mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-21 18:56:11 +10:00
[강운덕] [LUCYSUS-1744] 개별 트레이스에서 remoteaddress를 추가로 보여주도록함. agentId, applicationId를 보여주도록함.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@1336 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -38,6 +38,8 @@ public class RecordSetServiceImpl implements RecordSetService {
|
||||
// 오류로 인해 foucs를 못찾을수 도있으므로, 없을 경우 별도 mark가 추가적으로 있어야 함.
|
||||
// TODO 잘못 될수 있는점 foucusTime은 실제로 2개 이상 나올수 잇음. 서버의 time을 사용하므로 오차로 인해 2개가 나올수도 있음.
|
||||
SpanBo focusTimeSpanBo = findFocusTimeSpanBo(spanAlignList, focusTimestamp);
|
||||
recordSet.setAgentId(focusTimeSpanBo.getAgentId());
|
||||
recordSet.setApplicationId(focusTimeSpanBo.getApplicationId());
|
||||
|
||||
String applicationName = getRpcArgument(focusTimeSpanBo);
|
||||
recordSet.setApplicationName(applicationName);
|
||||
@@ -148,6 +150,11 @@ public class RecordSetServiceImpl implements RecordSetService {
|
||||
return recordList;
|
||||
}
|
||||
|
||||
private Record createParameterRecord(int depth, String method, String argument) {
|
||||
Record record = new Record(depth, false, method, argument, 0L, 0L, null, null, null, null);
|
||||
return record;
|
||||
}
|
||||
|
||||
private SpanBo findFocusTimeSpanBo(List<SpanAlign> spanAlignList, long focusTimestamp) {
|
||||
SpanBo firstSpan = null;
|
||||
for (SpanAlign spanAlign : spanAlignList) {
|
||||
@@ -186,6 +193,10 @@ public class RecordSetServiceImpl implements RecordSetService {
|
||||
|
||||
List<Record> annotationRecord = createAnnotationRecord(spanAlign.getDepth() + 1, spanBo.getAnnotationBoList());
|
||||
recordList.addAll(annotationRecord);
|
||||
if(spanBo.getRemoteAddr() != null) {
|
||||
Record remoteAddress = createParameterRecord(spanAlign.getDepth() + 1, "REMOTE_ADDRESS", spanBo.getRemoteAddr());
|
||||
recordList.add(remoteAddress);
|
||||
}
|
||||
} else {
|
||||
SpanEventBo spanEventBo = spanAlign.getSpanEventBo();
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ public class TraceId {
|
||||
}
|
||||
String[] parsedTraceId = TraceIdUtils.parseTraceId(traceId);
|
||||
this.most = TraceIdUtils.parseMostId(parsedTraceId);
|
||||
this.least = TraceIdUtils.parseLeastId(parsedTraceId);
|
||||
}
|
||||
this.least = TraceIdUtils.parseLeastId(parsedTraceId);
|
||||
}
|
||||
|
||||
public byte[] getBytes() {
|
||||
return BytesUtils.longLongToBytes(most, least);
|
||||
@@ -62,4 +62,12 @@ public class TraceId {
|
||||
String traceId = TraceIdUtils.formatString(most, least);
|
||||
return "TraceId [" + traceId + "]";
|
||||
}
|
||||
|
||||
public String getFormatString() {
|
||||
return TraceIdUtils.formatString(most, least);
|
||||
}
|
||||
|
||||
public String getFormatLong() {
|
||||
return this.most + ":" + this.least;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,16 @@ public class Record {
|
||||
public int getTab() {
|
||||
return tab;
|
||||
}
|
||||
public String getTabspace() {
|
||||
if(tab == 0) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i=0; i< tab; i++) {
|
||||
sb.append(" ");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isMethod() {
|
||||
return method;
|
||||
|
||||
@@ -14,6 +14,9 @@ public class RecordSet {
|
||||
private String applicationName;
|
||||
private long beginTimestamp;
|
||||
|
||||
private String agentId;
|
||||
private String applicationId;
|
||||
|
||||
public RecordSet() {
|
||||
}
|
||||
|
||||
@@ -66,5 +69,19 @@ public class RecordSet {
|
||||
}
|
||||
|
||||
|
||||
public String getAgentId() {
|
||||
return agentId;
|
||||
}
|
||||
|
||||
public void setAgentId(String agentId) {
|
||||
this.agentId = agentId;
|
||||
}
|
||||
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
public void setApplicationId(String applicationId) {
|
||||
this.applicationId = applicationId;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user