Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
e7b72eb2
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,体验更适合开发者的 AI 搜索 >>
提交
e7b72eb2
编写于
1月 04, 2018
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
catch up the TODO list.
上级
1fbb28d2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
28 deletion
+17
-28
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
...c/provider/handler/ApplicationRegisterServiceHandler.java
+8
-11
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
...rpc/provider/handler/InstanceDiscoveryServiceHandler.java
+1
-1
apm-protocol/apm-network/src/main/proto/ApplicationRegisterService.proto
...m-network/src/main/proto/ApplicationRegisterService.proto
+3
-4
apm-protocol/apm-network/src/main/proto/DiscoveryService.proto
...rotocol/apm-network/src/main/proto/DiscoveryService.proto
+1
-2
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java
...ng/apm/agent/core/remote/AppAndServiceRegisterClient.java
+4
-5
pom.xml
pom.xml
+0
-5
未找到文件。
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java
浏览文件 @
e7b72eb2
...
...
@@ -18,15 +18,14 @@
package
org.apache.skywalking.apm.collector.agent.grpc.provider.handler
;
import
com.google.protobuf.ProtocolStringList
;
import
io.grpc.stub.StreamObserver
;
import
org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.server.grpc.GRPCHandler
;
import
org.apache.skywalking.apm.network.proto.Application
;
import
org.apache.skywalking.apm.network.proto.ApplicationMappings
;
import
org.apache.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.Applications
;
import
org.apache.skywalking.apm.network.proto.KeyWithIntegerValue
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -44,19 +43,17 @@ public class ApplicationRegisterServiceHandler extends ApplicationRegisterServic
applicationIDService
=
moduleManager
.
find
(
AnalysisRegisterModule
.
NAME
).
getService
(
IApplicationIDService
.
class
);
}
@Override
public
void
batchRegister
(
Applications
request
,
StreamObserver
<
ApplicationMappings
>
responseObserver
)
{
@Override
public
void
applicationCodeRegister
(
Application
request
,
StreamObserver
<
ApplicationMappings
>
responseObserver
)
{
logger
.
debug
(
"register application"
);
ProtocolStringList
applicationCodes
=
request
.
getApplicationCodesList
();
ApplicationMappings
.
Builder
builder
=
ApplicationMappings
.
newBuilder
();
for
(
int
i
=
0
;
i
<
applicationCodes
.
size
();
i
++)
{
String
applicationCode
=
applicationCodes
.
get
(
i
);
int
applicationId
=
applicationIDService
.
getOrCreateForApplicationCode
(
applicationCode
);
String
applicationCode
=
request
.
getApplicationCode
();
int
applicationId
=
applicationIDService
.
getOrCreateForApplicationCode
(
applicationCode
);
if
(
applicationId
!=
0
)
{
KeyWithIntegerValue
value
=
KeyWithIntegerValue
.
newBuilder
().
setKey
(
applicationCode
).
setValue
(
applicationId
).
build
();
builder
.
addApplications
(
value
);
}
if
(
applicationId
!=
0
)
{
KeyWithIntegerValue
value
=
KeyWithIntegerValue
.
newBuilder
().
setKey
(
applicationCode
).
setValue
(
applicationId
).
build
();
builder
.
addApplications
(
value
);
}
responseObserver
.
onNext
(
builder
.
build
());
responseObserver
.
onCompleted
();
...
...
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java
浏览文件 @
e7b72eb2
...
...
@@ -47,7 +47,7 @@ public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrp
}
@Override
public
void
register
(
ApplicationInstance
request
,
StreamObserver
<
ApplicationInstanceMapping
>
responseObserver
)
{
public
void
register
Instance
(
ApplicationInstance
request
,
StreamObserver
<
ApplicationInstanceMapping
>
responseObserver
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
request
.
getRegisterTime
());
int
instanceId
=
instanceIDService
.
getOrCreateByAgentUUID
(
request
.
getApplicationId
(),
request
.
getAgentUUID
(),
timeBucket
,
buildOsInfo
(
request
.
getOsinfo
()));
ApplicationInstanceMapping
.
Builder
builder
=
ApplicationInstanceMapping
.
newBuilder
();
...
...
apm-protocol/apm-network/src/main/proto/ApplicationRegisterService.proto
浏览文件 @
e7b72eb2
...
...
@@ -7,13 +7,12 @@ import "KeyWithIntegerValue.proto";
//register service for ApplicationCode, this service is called when service starts.
service
ApplicationRegisterService
{
//TODO: TODO: `batchRegister` should be replaces by applicationCodeRegister
rpc
batchRegister
(
Applications
)
returns
(
ApplicationMappings
)
{
rpc
applicationCodeRegister
(
Application
)
returns
(
ApplicationMappings
)
{
}
}
message
Application
s
{
repeated
string
applicationCodes
=
1
;
message
Application
{
string
applicationCode
=
1
;
}
message
ApplicationMappings
{
...
...
apm-protocol/apm-network/src/main/proto/DiscoveryService.proto
浏览文件 @
e7b72eb2
...
...
@@ -6,8 +6,7 @@ option java_package = "org.apache.skywalking.apm.network.proto";
import
"Downstream.proto"
;
service
InstanceDiscoveryService
{
//TODO: need rename, `register` is a key word.
rpc
register
(
ApplicationInstance
)
returns
(
ApplicationInstanceMapping
)
{
rpc
registerInstance
(
ApplicationInstance
)
returns
(
ApplicationInstanceMapping
)
{
}
rpc
heartbeat
(
ApplicationInstanceHeartbeat
)
returns
(
Downstream
)
{
...
...
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/AppAndServiceRegisterClient.java
浏览文件 @
e7b72eb2
...
...
@@ -37,12 +37,12 @@ import org.apache.skywalking.apm.agent.core.dictionary.OperationNameDictionary;
import
org.apache.skywalking.apm.agent.core.logging.api.ILog
;
import
org.apache.skywalking.apm.agent.core.logging.api.LogManager
;
import
org.apache.skywalking.apm.agent.core.os.OSUtil
;
import
org.apache.skywalking.apm.network.proto.Application
;
import
org.apache.skywalking.apm.network.proto.ApplicationInstance
;
import
org.apache.skywalking.apm.network.proto.ApplicationInstanceHeartbeat
;
import
org.apache.skywalking.apm.network.proto.ApplicationInstanceMapping
;
import
org.apache.skywalking.apm.network.proto.ApplicationMappings
;
import
org.apache.skywalking.apm.network.proto.ApplicationRegisterServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.Applications
;
import
org.apache.skywalking.apm.network.proto.InstanceDiscoveryServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.NetworkAddressRegisterServiceGrpc
;
import
org.apache.skywalking.apm.network.proto.ServiceNameDiscoveryServiceGrpc
;
...
...
@@ -109,9 +109,8 @@ public class AppAndServiceRegisterClient implements BootService, GRPCChannelList
try
{
if
(
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
==
DictionaryUtil
.
nullValue
())
{
if
(
applicationRegisterServiceBlockingStub
!=
null
)
{
//TODO: `batchRegister` should be replaces by applicationCodeRegister
ApplicationMappings
applicationMapping
=
applicationRegisterServiceBlockingStub
.
batchRegister
(
Applications
.
newBuilder
().
addApplicationCodes
(
Config
.
Agent
.
APPLICATION_CODE
).
build
());
ApplicationMappings
applicationMapping
=
applicationRegisterServiceBlockingStub
.
applicationCodeRegister
(
Application
.
newBuilder
().
setApplicationCode
(
Config
.
Agent
.
APPLICATION_CODE
).
build
());
if
(
applicationMapping
.
getApplicationsCount
()
>
0
)
{
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
=
applicationMapping
.
getApplications
(
0
).
getValue
();
shouldTry
=
true
;
...
...
@@ -121,7 +120,7 @@ public class AppAndServiceRegisterClient implements BootService, GRPCChannelList
if
(
instanceDiscoveryServiceBlockingStub
!=
null
)
{
if
(
RemoteDownstreamConfig
.
Agent
.
APPLICATION_INSTANCE_ID
==
DictionaryUtil
.
nullValue
())
{
ApplicationInstanceMapping
instanceMapping
=
instanceDiscoveryServiceBlockingStub
.
register
(
ApplicationInstance
.
newBuilder
()
ApplicationInstanceMapping
instanceMapping
=
instanceDiscoveryServiceBlockingStub
.
register
Instance
(
ApplicationInstance
.
newBuilder
()
.
setApplicationId
(
RemoteDownstreamConfig
.
Agent
.
APPLICATION_ID
)
.
setAgentUUID
(
PROCESS_UUID
)
.
setRegisterTime
(
System
.
currentTimeMillis
())
...
...
pom.xml
浏览文件 @
e7b72eb2
...
...
@@ -68,11 +68,6 @@
<url>
https://github.com/apache/incubator-skywalking/issues
</url>
</issueManagement>
<ciManagement>
<system>
travis
</system>
<url>
https://travis-ci.org/wu-sheng/sky-walking
</url>
</ciManagement>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录