repair bug id split and node finder

This commit is contained in:
pengys5 2017-03-24 17:57:29 +08:00
parent dac1a24110
commit 54ae4b938d
5 changed files with 19 additions and 8 deletions

View File

@ -52,13 +52,19 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
dataJsonObj.addProperty(NodeIndex.Time_Slice, timeSlice);
logger.debug("span id=%s, kind=%s, layer=%s, component=%s, code=%s", span.getSpanId(), kind, layer, component, code);
String id = timeSlice + Const.ID_SPLIT + code;
logger.debug("leaf client node: %s", dataJsonObj.toString());
dataJsonObj.addProperty(NodeIndex.Code, code);
dataJsonObj.addProperty(NodeIndex.NickName, code);
setRecord(id, dataJsonObj);
if (Tags.SPAN_KIND_CLIENT.equals(kind) && ClientSpanIsLeafTools.isLeaf(span.getSpanId(), spanList)) {
logger.debug("The span id %s which kind is client and is a leaf span", span.getSpanId());
code = SpanPeersTools.getPeers(span);
dataJsonObj.addProperty(NodeIndex.Code, code);
dataJsonObj.addProperty(NodeIndex.NickName, code);
String id = timeSlice + Const.ID_SPLIT + code;
id = timeSlice + Const.ID_SPLIT + code;
logger.debug("leaf client node: %s", dataJsonObj.toString());
setRecord(id, dataJsonObj);
} else if (Tags.SPAN_KIND_SERVER.equals(kind) && span.getParentSpanId() == -1) {
@ -75,7 +81,7 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
logger.debug("user node: %s", userDataJsonObj.toString());
setRecord(userId, userDataJsonObj);
String id = timeSlice + Const.ID_SPLIT + code;
id = timeSlice + Const.ID_SPLIT + code;
dataJsonObj.addProperty(NodeIndex.NickName, code);
logger.debug("refs node: %s", dataJsonObj.toString());
setRecord(id, dataJsonObj);
@ -83,7 +89,7 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
for (TraceSegmentRef segmentRef : segment.getRefs()) {
String nickName = Const.PEERS_FRONT_SPLIT + segmentRef.getPeerHost() + Const.PEERS_BEHIND_SPLIT;
dataJsonObj.addProperty(NodeIndex.NickName, nickName);
String id = timeSlice + Const.ID_SPLIT + code;
id = timeSlice + Const.ID_SPLIT + code;
logger.debug("refs node: %s", dataJsonObj.toString());
setRecord(id, dataJsonObj);
}

View File

@ -20,7 +20,7 @@ public class MetricData extends AbstractHashMessage {
this.id = id;
value = new HashMap<>();
String[] ids = id.split(Const.ID_SPLIT);
String[] ids = id.split(Const.IDS_SPLIT);
String slice = ids[0];
String aggId = "";
for (int i = 1; i < ids.length; i++) {

View File

@ -17,7 +17,7 @@ public class RecordData extends AbstractHashMessage {
public RecordData(String key) {
super(key);
this.id = key;
String[] ids = id.split(Const.ID_SPLIT);
String[] ids = id.split(Const.IDS_SPLIT);
for (int i = 1; i < ids.length; i++) {
if (i == 1) {
this.aggId = ids[i];

View File

@ -2,3 +2,6 @@ cluster.current.hostname=127.0.0.1
cluster.current.port=1000
cluster.current.roles=[WorkersListener]
#cluster.seed_nodes=["akka.tcp://CollectorSystem@127.0.0.1:1000"]
es.cluster.name=
es.cluster.nodes=