Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
4e2768d7
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
4e2768d7
编写于
6月 08, 2017
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some compile issues.
上级
6745e50f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
40 deletion
+37
-40
LICENSE
LICENSE
+2
-2
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/Span.java
...pm-trace/src/main/java/org/skywalking/apm/trace/Span.java
+16
-16
apm-commons/apm-trace/src/test/java/org/skywalking/apm/trace/SpanTestCase.java
.../src/test/java/org/skywalking/apm/trace/SpanTestCase.java
+2
-3
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracerContext.java
.../org/skywalking/apm/agent/core/context/TracerContext.java
+6
-8
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/DubboSpanGenerator.java
.../sniffer/mock/trace/builders/span/DubboSpanGenerator.java
+3
-3
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/MySQLGenerator.java
.../apm/sniffer/mock/trace/builders/span/MySQLGenerator.java
+2
-2
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/TomcatSpanGenerator.java
...sniffer/mock/trace/builders/span/TomcatSpanGenerator.java
+6
-6
未找到文件。
LICENSE
浏览文件 @
4e2768d7
...
...
@@ -285,7 +285,7 @@ in one of these ways:
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer
-to-peer
transmission, provided
e) Convey the object code using peer
_host-to-peer_host
transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
...
...
@@ -436,7 +436,7 @@ material under section 10.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer
-to-peer
transmission
occurring solely as a consequence of using peer
_host-to-peer_host
transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
...
...
apm-commons/apm-trace/src/main/java/org/skywalking/apm/trace/Span.java
浏览文件 @
4e2768d7
...
...
@@ -4,16 +4,16 @@ import com.google.gson.Gson;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.JsonObject
;
import
com.google.gson.TypeAdapter
;
import
com.google.gson.annotations.Expose
;
import
com.google.gson.annotations.JsonAdapter
;
import
com.google.gson.annotations.SerializedName
;
import
com.google.gson.stream.JsonReader
;
import
com.google.gson.stream.JsonWriter
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.*
;
import
org.skywalking.apm.trace.TraceId.DistributedTraceIds
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.skywalking.apm.trace.tag.BooleanTagItem
;
import
org.skywalking.apm.trace.tag.IntTagItem
;
import
org.skywalking.apm.trace.tag.StringTagItem
;
...
...
@@ -30,7 +30,7 @@ import org.skywalking.apm.util.StringUtil;
*/
@JsonAdapter
(
Span
.
Serializer
.
class
)
public
class
Span
{
private
static
Gson
gson
=
new
GsonBuilder
().
excludeFieldsWithoutExposeAnnotation
().
create
();
private
static
Gson
SERIALIZATION_GSON
=
new
GsonBuilder
().
excludeFieldsWithoutExposeAnnotation
().
create
();
private
int
spanId
;
private
int
parentSpanId
;
...
...
@@ -53,10 +53,10 @@ public class Span {
private
String
operationName
;
/**
* {@link #peer}, {@link #port} and {@link #peers} were part of tags,
* {@link #peer
_host
}, {@link #port} and {@link #peers} were part of tags,
* independence them from tags for better performance and gc.
*/
private
String
peer
;
private
String
peer
_host
;
private
int
port
;
...
...
@@ -334,8 +334,8 @@ public class Span {
return
false
;
}
public
String
getPeer
()
{
return
peer
;
public
String
getPeer
Host
()
{
return
peer
_host
;
}
public
int
getPort
()
{
...
...
@@ -346,8 +346,8 @@ public class Span {
return
peers
;
}
public
void
setPeer
(
String
peer
)
{
this
.
peer
=
peer
;
public
void
setPeer
_host
(
String
peer_host
)
{
this
.
peer
_host
=
peer_host
;
}
public
void
setPort
(
int
port
)
{
...
...
@@ -380,8 +380,8 @@ public class Span {
this
.
writeTags
(
out
,
span
);
if
(
span
.
logs
!=
null
)
{
out
.
name
(
"logs"
).
jsonValue
(
gson
.
toJson
(
span
.
logs
));
if
(
span
.
logs
!=
null
)
{
out
.
name
(
"logs"
).
jsonValue
(
SERIALIZATION_GSON
.
toJson
(
span
.
logs
));
}
out
.
endObject
();
...
...
@@ -391,9 +391,9 @@ public class Span {
JsonObject
tagWithStr
=
null
;
JsonObject
tagWithInt
=
null
;
JsonObject
tagWithBool
=
null
;
if
(!
StringUtil
.
isEmpty
(
span
.
peer
))
{
if
(!
StringUtil
.
isEmpty
(
span
.
peer
_host
))
{
tagWithStr
=
new
JsonObject
();
tagWithStr
.
addProperty
(
"peer.host"
,
span
.
peer
);
tagWithStr
.
addProperty
(
"peer.host"
,
span
.
peer
_host
);
tagWithInt
=
new
JsonObject
();
tagWithInt
.
addProperty
(
"peer.port"
,
span
.
port
);
}
else
if
(!
StringUtil
.
isEmpty
(
span
.
peers
))
{
...
...
apm-commons/apm-trace/src/test/java/org/skywalking/apm/trace/SpanTestCase.java
浏览文件 @
4e2768d7
...
...
@@ -8,7 +8,6 @@ import org.skywalking.apm.trace.tag.StringTagReader;
import
org.skywalking.apm.trace.tag.Tags
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by wusheng on 2017/2/18.
...
...
@@ -45,14 +44,14 @@ public class SpanTestCase {
Span
span1
=
new
Span
(
0
,
"serviceA"
);
Tags
.
SPAN_LAYER
.
asHttp
(
span1
);
Tags
.
COMPONENT
.
set
(
span1
,
"Spring"
);
span1
.
setPeer
(
"127.0.0.1"
);
span1
.
setPeer
_host
(
"127.0.0.1"
);
Tags
.
ERROR
.
set
(
span1
,
true
);
Tags
.
STATUS_CODE
.
set
(
span1
,
302
);
Tags
.
URL
.
set
(
span1
,
"http://127.0.0.1/serviceA"
);
Tags
.
DB_STATEMENT
.
set
(
span1
,
"select * from users"
);
Assert
.
assertEquals
(
"http"
,
StringTagReader
.
get
(
span1
,
Tags
.
SPAN_LAYER
.
SPAN_LAYER_TAG
));
Assert
.
assertEquals
(
"127.0.0.1"
,
span1
.
getPeer
());
Assert
.
assertEquals
(
"127.0.0.1"
,
span1
.
getPeer
Host
());
Assert
.
assertTrue
(
BooleanTagReader
.
get
(
span1
,
Tags
.
ERROR
));
}
...
...
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracerContext.java
浏览文件 @
4e2768d7
package
org.skywalking.apm.agent.core.context
;
import
org.skywalking.apm.agent.core.conf.Config
;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.skywalking.apm.agent.core.boot.ServiceManager
;
import
org.skywalking.apm.agent.core.conf.Config
;
import
org.skywalking.apm.agent.core.sampling.SamplingService
;
import
org.skywalking.apm.trace.Span
;
import
org.skywalking.apm.trace.TraceSegment
;
import
org.skywalking.apm.trace.TraceSegmentRef
;
import
org.skywalking.apm.trace.tag.Tags
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
* {@link TracerContext} maintains the context.
...
...
@@ -148,12 +146,12 @@ public final class TracerContext {
Span
span
=
this
.
activeSpan
();
carrier
.
setSpanId
(
span
.
getSpanId
());
carrier
.
setApplicationCode
(
Config
.
Agent
.
APPLICATION_CODE
);
String
host
=
Tags
.
PEER_HOST
.
get
(
span
);
String
host
=
span
.
getPeerHost
(
);
if
(
host
!=
null
)
{
Integer
port
=
Tags
.
PEER_PORT
.
get
(
span
);
Integer
port
=
span
.
getPort
(
);
carrier
.
setPeerHost
(
host
+
":"
+
port
);
}
else
{
carrier
.
setPeerHost
(
Tags
.
PEERS
.
get
(
span
));
carrier
.
setPeerHost
(
span
.
getPeers
(
));
}
carrier
.
setDistributedTraceIds
(
this
.
segment
.
getRelatedGlobalTraces
());
carrier
.
setSampled
(
this
.
segment
.
isSampled
());
...
...
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/DubboSpanGenerator.java
浏览文件 @
4e2768d7
...
...
@@ -18,8 +18,8 @@ public class DubboSpanGenerator {
Tags
.
COMPONENT
.
set
(
span
,
"Dubbo"
);
Tags
.
URL
.
set
(
span
,
"rest://192.168.1.8:20880/default_rpc/org.skywalking.apm.test.persistence.PersistenceService.query(String)"
);
Tags
.
SPAN_KIND
.
set
(
span
,
Tags
.
SPAN_KIND_SERVER
);
Tags
.
PEER_HOST
.
set
(
span
,
"192.168.1.8"
);
Tags
.
PEER_PORT
.
set
(
span
,
20880
);
span
.
setPeer_host
(
"192.168.1.8"
);
span
.
setPort
(
20880
);
Tags
.
SPAN_LAYER
.
asHttp
(
span
);
}
...
...
@@ -36,7 +36,7 @@ public class DubboSpanGenerator {
Tags
.
COMPONENT
.
set
(
span
,
"Dubbo"
);
Tags
.
URL
.
set
(
span
,
"rest://192.168.1.8:20880/default_rpc/org.skywalking.apm.test.persistence.PersistenceService.query(String)"
);
Tags
.
SPAN_KIND
.
set
(
span
,
Tags
.
SPAN_KIND_CLIENT
);
Tags
.
PEER_HOST
.
set
(
span
,
"10.21.9.35"
);
span
.
setPeer_host
(
"10.21.9.35"
);
Tags
.
SPAN_LAYER
.
asHttp
(
span
);
}
...
...
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/MySQLGenerator.java
浏览文件 @
4e2768d7
...
...
@@ -16,8 +16,8 @@ public class MySQLGenerator {
Span
span
=
ContextManager
.
createSpan
(
"mysql/jdbi/statement/executeQuery"
);
Tags
.
COMPONENT
.
set
(
span
,
"Mysql"
);
Tags
.
SPAN_KIND
.
set
(
span
,
Tags
.
SPAN_KIND_CLIENT
);
Tags
.
PEER_HOST
.
set
(
span
,
"10.5.34.18"
);
Tags
.
PEER_PORT
.
set
(
span
,
30088
);
span
.
setPeer_host
(
"10.5.34.18"
);
span
.
setPort
(
30088
);
Tags
.
DB_INSTANCE
.
set
(
span
,
"mysql-instance"
);
Tags
.
DB_STATEMENT
.
set
(
span
,
"select * from users where user_id = 1"
);
Tags
.
DB_TYPE
.
set
(
span
,
"sql"
);
...
...
apm-sniffer/apm-sniffer-mock/src/main/java/org/skywalking/apm/sniffer/mock/trace/builders/span/TomcatSpanGenerator.java
浏览文件 @
4e2768d7
...
...
@@ -19,8 +19,8 @@ public class TomcatSpanGenerator {
Tags
.
COMPONENT
.
set
(
webSpan
,
"Tomcat"
);
Tags
.
URL
.
set
(
webSpan
,
"http://10.21.9.35/web/serviceA"
);
Tags
.
SPAN_KIND
.
set
(
webSpan
,
Tags
.
SPAN_KIND_SERVER
);
Tags
.
PEER_HOST
.
set
(
webSpan
,
"10.21.9.35"
);
Tags
.
PEER_PORT
.
set
(
webSpan
,
80
);
webSpan
.
setPeer_host
(
"10.21.9.35"
);
webSpan
.
setPort
(
80
);
Tags
.
SPAN_LAYER
.
asHttp
(
webSpan
);
}
...
...
@@ -41,8 +41,8 @@ public class TomcatSpanGenerator {
Tags
.
COMPONENT
.
set
(
webSpan
,
"Tomcat"
);
Tags
.
URL
.
set
(
webSpan
,
"http://10.21.9.35/web/unknown"
);
Tags
.
SPAN_KIND
.
set
(
webSpan
,
Tags
.
SPAN_KIND_SERVER
);
Tags
.
PEER_HOST
.
set
(
webSpan
,
"10.21.9.35"
);
Tags
.
PEER_PORT
.
set
(
webSpan
,
80
);
webSpan
.
setPeer_host
(
"10.21.9.35"
);
webSpan
.
setPort
(
80
);
Tags
.
SPAN_LAYER
.
asHttp
(
webSpan
);
}
...
...
@@ -64,8 +64,8 @@ public class TomcatSpanGenerator {
Tags
.
COMPONENT
.
set
(
webSpan
,
"Tomcat"
);
Tags
.
URL
.
set
(
webSpan
,
"http://10.21.9.35/web/error/service"
);
Tags
.
SPAN_KIND
.
set
(
webSpan
,
Tags
.
SPAN_KIND_SERVER
);
Tags
.
PEER_HOST
.
set
(
webSpan
,
"10.21.9.35"
);
Tags
.
PEER_PORT
.
set
(
webSpan
,
80
);
webSpan
.
setPeer_host
(
"10.21.9.35"
);
webSpan
.
setPort
(
80
);
Tags
.
SPAN_LAYER
.
asHttp
(
webSpan
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录