未验证 提交 2cac8662 编写于 作者: S StyleTang 提交者: GitHub

[ISSUE #3136] TraceDataEncoder add SubAfter trace bean timestamp (#3137)

* [ISSUE #3136] TraceDataEncoder add SubAfter trace bean timestamp

* add SubAfter TraceBean TimeStamp and GroupName back
上级 7c7e9aca
...@@ -188,8 +188,9 @@ public class TraceDataEncoder { ...@@ -188,8 +188,9 @@ public class TraceDataEncoder {
.append(ctx.getCostTime()).append(TraceConstants.CONTENT_SPLITOR)// .append(ctx.getCostTime()).append(TraceConstants.CONTENT_SPLITOR)//
.append(ctx.isSuccess()).append(TraceConstants.CONTENT_SPLITOR)// .append(ctx.isSuccess()).append(TraceConstants.CONTENT_SPLITOR)//
.append(bean.getKeys()).append(TraceConstants.CONTENT_SPLITOR)// .append(bean.getKeys()).append(TraceConstants.CONTENT_SPLITOR)//
.append(ctx.getContextCode()).append(TraceConstants.FIELD_SPLITOR); .append(ctx.getContextCode()).append(TraceConstants.CONTENT_SPLITOR)
.append(ctx.getTimeStamp()).append(TraceConstants.CONTENT_SPLITOR)
.append(ctx.getGroupName()).append(TraceConstants.FIELD_SPLITOR);
} }
} }
break; break;
......
...@@ -189,6 +189,8 @@ public class TraceDataEncoderTest { ...@@ -189,6 +189,8 @@ public class TraceDataEncoderTest {
subAfterContext.setRequestId("3455848576927"); subAfterContext.setRequestId("3455848576927");
subAfterContext.setCostTime(20); subAfterContext.setCostTime(20);
subAfterContext.setSuccess(true); subAfterContext.setSuccess(true);
subAfterContext.setTimeStamp(1625883640000L);
subAfterContext.setGroupName("GroupName-test");
subAfterContext.setContextCode(98623046); subAfterContext.setContextCode(98623046);
TraceBean bean = new TraceBean(); TraceBean bean = new TraceBean();
bean.setMsgId("AC1415116D1418B4AAC217FE1B4E0000"); bean.setMsgId("AC1415116D1418B4AAC217FE1B4E0000");
...@@ -200,7 +202,7 @@ public class TraceDataEncoderTest { ...@@ -200,7 +202,7 @@ public class TraceDataEncoderTest {
String transData = traceTransferBean.getTransData(); String transData = traceTransferBean.getTransData();
Assert.assertNotNull(transData); Assert.assertNotNull(transData);
String[] items = transData.split(String.valueOf(TraceConstants.CONTENT_SPLITOR)); String[] items = transData.split(String.valueOf(TraceConstants.CONTENT_SPLITOR));
Assert.assertEquals(7, items.length); Assert.assertEquals(9, items.length);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册