Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿信在这里
SkyWalking
提交
eb72cb04
S
SkyWalking
项目概览
阿信在这里
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eb72cb04
编写于
8月 08, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change the static json key name to full name in json reader.
上级
82f79a73
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
70 addition
and
70 deletion
+70
-70
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/LogJsonReader.java
...ector/agentstream/jetty/handler/reader/LogJsonReader.java
+4
-4
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/ReferenceJsonReader.java
...agentstream/jetty/handler/reader/ReferenceJsonReader.java
+22
-22
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SegmentJsonReader.java
...r/agentstream/jetty/handler/reader/SegmentJsonReader.java
+10
-10
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SpanJsonReader.java
...ctor/agentstream/jetty/handler/reader/SpanJsonReader.java
+30
-30
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReader.java
...ntstream/jetty/handler/reader/TraceSegmentJsonReader.java
+4
-4
未找到文件。
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/LogJsonReader.java
浏览文件 @
eb72cb04
...
...
@@ -11,17 +11,17 @@ public class LogJsonReader implements StreamJsonReader<LogMessage> {
private
KeyWithStringValueJsonReader
keyWithStringValueJsonReader
=
new
KeyWithStringValueJsonReader
();
private
static
final
String
TI
=
"ti"
;
private
static
final
String
L
D
=
"ld"
;
private
static
final
String
TI
ME
=
"ti"
;
private
static
final
String
L
OG_DATA
=
"ld"
;
@Override
public
LogMessage
read
(
JsonReader
reader
)
throws
IOException
{
LogMessage
.
Builder
builder
=
LogMessage
.
newBuilder
();
while
(
reader
.
hasNext
())
{
switch
(
reader
.
nextName
())
{
case
TI:
case
TI
ME
:
builder
.
setTime
(
reader
.
nextLong
());
case
L
D
:
case
L
OG_DATA
:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
builder
.
addData
(
keyWithStringValueJsonReader
.
read
(
reader
));
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/ReferenceJsonReader.java
浏览文件 @
eb72cb04
...
...
@@ -11,17 +11,17 @@ public class ReferenceJsonReader implements StreamJsonReader<TraceSegmentReferen
private
UniqueIdJsonReader
uniqueIdJsonReader
=
new
UniqueIdJsonReader
();
private
static
final
String
TS
=
"ts"
;
private
static
final
String
AI
=
"ai"
;
private
static
final
String
SI
=
"si"
;
private
static
final
String
VI
=
"vi"
;
private
static
final
String
VN
=
"vn"
;
private
static
final
String
N
I
=
"ni"
;
private
static
final
String
N
N
=
"nn"
;
private
static
final
String
E
A
=
"ea"
;
private
static
final
String
E
I
=
"ei"
;
private
static
final
String
EN
=
"en"
;
private
static
final
String
R
V
=
"rv"
;
private
static
final
String
PARENT_TRACE_SEGMENT_ID
=
"ts"
;
private
static
final
String
PARENT_APPLICATION_ID
=
"ai"
;
private
static
final
String
PARENT_SPAN_ID
=
"si"
;
private
static
final
String
PARENT_SERVICE_ID
=
"vi"
;
private
static
final
String
PARENT_SERVICE_NAME
=
"vn"
;
private
static
final
String
N
ETWORK_ADDRESS_ID
=
"ni"
;
private
static
final
String
N
ETWORK_ADDRESS
=
"nn"
;
private
static
final
String
E
NTRY_APPLICATION_INSTANCE_ID
=
"ea"
;
private
static
final
String
E
NTRY_SERVICE_ID
=
"ei"
;
private
static
final
String
EN
TRY_SERVICE_NAME
=
"en"
;
private
static
final
String
R
EF_TYPE_VALUE
=
"rv"
;
@Override
public
TraceSegmentReference
read
(
JsonReader
reader
)
throws
IOException
{
TraceSegmentReference
.
Builder
builder
=
TraceSegmentReference
.
newBuilder
();
...
...
@@ -29,37 +29,37 @@ public class ReferenceJsonReader implements StreamJsonReader<TraceSegmentReferen
reader
.
beginObject
();
while
(
reader
.
hasNext
())
{
switch
(
reader
.
nextName
())
{
case
TS
:
case
PARENT_TRACE_SEGMENT_ID
:
builder
.
setParentTraceSegmentId
(
uniqueIdJsonReader
.
read
(
reader
));
break
;
case
AI
:
case
PARENT_APPLICATION_ID
:
builder
.
setParentApplicationInstanceId
(
reader
.
nextInt
());
break
;
case
SI
:
case
PARENT_SPAN_ID
:
builder
.
setParentSpanId
(
reader
.
nextInt
());
break
;
case
VI
:
case
PARENT_SERVICE_ID
:
builder
.
setParentServiceId
(
reader
.
nextInt
());
break
;
case
VN
:
case
PARENT_SERVICE_NAME
:
builder
.
setParentServiceName
(
reader
.
nextString
());
break
;
case
N
I
:
case
N
ETWORK_ADDRESS_ID
:
builder
.
setNetworkAddressId
(
reader
.
nextInt
());
break
;
case
N
N
:
case
N
ETWORK_ADDRESS
:
builder
.
setNetworkAddress
(
reader
.
nextString
());
break
;
case
E
A
:
case
E
NTRY_APPLICATION_INSTANCE_ID
:
builder
.
setEntryApplicationInstanceId
(
reader
.
nextInt
());
break
;
case
E
I
:
case
E
NTRY_SERVICE_ID
:
builder
.
setEntryServiceId
(
reader
.
nextInt
());
break
;
case
EN:
case
EN
TRY_SERVICE_NAME
:
builder
.
setEntryServiceName
(
reader
.
nextString
());
break
;
case
R
V
:
case
R
EF_TYPE_VALUE
:
builder
.
setRefTypeValue
(
reader
.
nextInt
());
break
;
default
:
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SegmentJsonReader.java
浏览文件 @
eb72cb04
...
...
@@ -17,11 +17,11 @@ public class SegmentJsonReader implements StreamJsonReader<TraceSegmentObject> {
private
ReferenceJsonReader
referenceJsonReader
=
new
ReferenceJsonReader
();
private
SpanJsonReader
spanJsonReader
=
new
SpanJsonReader
();
private
static
final
String
T
S
=
"ts"
;
private
static
final
String
A
I
=
"ai"
;
private
static
final
String
II
=
"ii"
;
private
static
final
String
RS
=
"rs"
;
private
static
final
String
SS
=
"ss"
;
private
static
final
String
T
RACE_SEGMENT_ID
=
"ts"
;
private
static
final
String
A
PPLICATION_ID
=
"ai"
;
private
static
final
String
APPLICATION_INSTANCE_ID
=
"ii"
;
private
static
final
String
TRACE_SEGMENT_REFERENCE
=
"rs"
;
private
static
final
String
S
PAN
S
=
"ss"
;
@Override
public
TraceSegmentObject
read
(
JsonReader
reader
)
throws
IOException
{
TraceSegmentObject
.
Builder
builder
=
TraceSegmentObject
.
newBuilder
();
...
...
@@ -29,7 +29,7 @@ public class SegmentJsonReader implements StreamJsonReader<TraceSegmentObject> {
reader
.
beginObject
();
while
(
reader
.
hasNext
())
{
switch
(
reader
.
nextName
())
{
case
T
S
:
case
T
RACE_SEGMENT_ID
:
builder
.
setTraceSegmentId
(
uniqueIdJsonReader
.
read
(
reader
));
if
(
logger
.
isDebugEnabled
())
{
StringBuilder
segmentId
=
new
StringBuilder
();
...
...
@@ -37,20 +37,20 @@ public class SegmentJsonReader implements StreamJsonReader<TraceSegmentObject> {
logger
.
debug
(
"segment id: {}"
,
segmentId
);
}
break
;
case
A
I
:
case
A
PPLICATION_ID
:
builder
.
setApplicationId
(
reader
.
nextInt
());
break
;
case
II
:
case
APPLICATION_INSTANCE_ID
:
builder
.
setApplicationInstanceId
(
reader
.
nextInt
());
break
;
case
RS
:
case
TRACE_SEGMENT_REFERENCE
:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
builder
.
addRefs
(
referenceJsonReader
.
read
(
reader
));
}
reader
.
endArray
();
break
;
case
SS:
case
S
PAN
S:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
builder
.
addSpans
(
spanJsonReader
.
read
(
reader
));
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/SpanJsonReader.java
浏览文件 @
eb72cb04
...
...
@@ -12,21 +12,21 @@ public class SpanJsonReader implements StreamJsonReader<SpanObject> {
private
KeyWithStringValueJsonReader
keyWithStringValueJsonReader
=
new
KeyWithStringValueJsonReader
();
private
LogJsonReader
logJsonReader
=
new
LogJsonReader
();
private
static
final
String
S
I
=
"si"
;
private
static
final
String
TV
=
"tv"
;
private
static
final
String
LV
=
"lv"
;
private
static
final
String
P
S
=
"ps"
;
private
static
final
String
ST
=
"st"
;
private
static
final
String
E
T
=
"et"
;
private
static
final
String
C
I
=
"ci"
;
private
static
final
String
C
N
=
"cn"
;
private
static
final
String
O
I
=
"oi"
;
private
static
final
String
O
N
=
"on"
;
private
static
final
String
P
I
=
"pi"
;
private
static
final
String
P
N
=
"pn"
;
private
static
final
String
I
E
=
"ie"
;
private
static
final
String
T
O
=
"to"
;
private
static
final
String
LO
=
"lo"
;
private
static
final
String
S
PAN_ID
=
"si"
;
private
static
final
String
SPAN_TYPE_VALUE
=
"tv"
;
private
static
final
String
SPAN_LAYER_VALUE
=
"lv"
;
private
static
final
String
P
ARENT_SPAN_ID
=
"ps"
;
private
static
final
String
ST
ART_TIME
=
"st"
;
private
static
final
String
E
ND_TIME
=
"et"
;
private
static
final
String
C
OMPONENT_ID
=
"ci"
;
private
static
final
String
C
OMPONENT_NAME
=
"cn"
;
private
static
final
String
O
PERATION_NAME_ID
=
"oi"
;
private
static
final
String
O
PERATION_NAME
=
"on"
;
private
static
final
String
P
EER_ID
=
"pi"
;
private
static
final
String
P
EER
=
"pn"
;
private
static
final
String
I
S_ERROR
=
"ie"
;
private
static
final
String
T
AGS
=
"to"
;
private
static
final
String
LO
GS
=
"lo"
;
@Override
public
SpanObject
read
(
JsonReader
reader
)
throws
IOException
{
SpanObject
.
Builder
builder
=
SpanObject
.
newBuilder
();
...
...
@@ -34,53 +34,53 @@ public class SpanJsonReader implements StreamJsonReader<SpanObject> {
reader
.
beginObject
();
while
(
reader
.
hasNext
())
{
switch
(
reader
.
nextName
())
{
case
S
I
:
case
S
PAN_ID
:
builder
.
setSpanId
(
reader
.
nextInt
());
break
;
case
TV
:
case
SPAN_TYPE_VALUE
:
builder
.
setSpanTypeValue
(
reader
.
nextInt
());
break
;
case
LV
:
case
SPAN_LAYER_VALUE
:
builder
.
setSpanLayerValue
(
reader
.
nextInt
());
break
;
case
P
S
:
case
P
ARENT_SPAN_ID
:
builder
.
setParentSpanId
(
reader
.
nextInt
());
break
;
case
ST:
case
ST
ART_TIME
:
builder
.
setStartTime
(
reader
.
nextLong
());
break
;
case
E
T
:
case
E
ND_TIME
:
builder
.
setEndTime
(
reader
.
nextLong
());
break
;
case
C
I
:
case
C
OMPONENT_ID
:
builder
.
setComponentId
(
reader
.
nextInt
());
break
;
case
C
N
:
case
C
OMPONENT_NAME
:
builder
.
setComponent
(
reader
.
nextString
());
break
;
case
O
I
:
case
O
PERATION_NAME_ID
:
builder
.
setOperationNameId
(
reader
.
nextInt
());
break
;
case
O
N
:
case
O
PERATION_NAME
:
builder
.
setOperationName
(
reader
.
nextString
());
break
;
case
P
I
:
case
P
EER_ID
:
builder
.
setPeerId
(
reader
.
nextInt
());
break
;
case
P
N
:
case
P
EER
:
builder
.
setPeer
(
reader
.
nextString
());
break
;
case
I
E
:
case
I
S_ERROR
:
builder
.
setIsError
(
reader
.
nextBoolean
());
break
;
case
T
O
:
case
T
AGS
:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
builder
.
addTags
(
keyWithStringValueJsonReader
.
read
(
reader
));
}
reader
.
endArray
();
break
;
case
LO:
case
LO
GS
:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
builder
.
addLogs
(
logJsonReader
.
read
(
reader
));
...
...
apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/jetty/handler/reader/TraceSegmentJsonReader.java
浏览文件 @
eb72cb04
...
...
@@ -15,8 +15,8 @@ public class TraceSegmentJsonReader implements StreamJsonReader<TraceSegment> {
private
UniqueIdJsonReader
uniqueIdJsonReader
=
new
UniqueIdJsonReader
();
private
SegmentJsonReader
segmentJsonReader
=
new
SegmentJsonReader
();
private
static
final
String
G
T
=
"gt"
;
private
static
final
String
S
G
=
"sg"
;
private
static
final
String
G
LOBAL_TRACE_IDS
=
"gt"
;
private
static
final
String
S
EGMENT
=
"sg"
;
@Override
public
TraceSegment
read
(
JsonReader
reader
)
throws
IOException
{
TraceSegment
traceSegment
=
new
TraceSegment
();
...
...
@@ -24,7 +24,7 @@ public class TraceSegmentJsonReader implements StreamJsonReader<TraceSegment> {
reader
.
beginObject
();
while
(
reader
.
hasNext
())
{
switch
(
reader
.
nextName
())
{
case
G
T
:
case
G
LOBAL_TRACE_IDS
:
reader
.
beginArray
();
while
(
reader
.
hasNext
())
{
traceSegment
.
addGlobalTraceId
(
uniqueIdJsonReader
.
read
(
reader
));
...
...
@@ -39,7 +39,7 @@ public class TraceSegmentJsonReader implements StreamJsonReader<TraceSegment> {
});
}
break
;
case
S
G
:
case
S
EGMENT
:
traceSegment
.
setTraceSegmentObject
(
segmentJsonReader
.
read
(
reader
));
break
;
default
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录