Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
7047c97e
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
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,发现更多精彩内容 >>
提交
7047c97e
编写于
3月 20, 2019
作者:
L
Lemon
提交者:
彭勇升 pengys
3月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add CLR_Receiver plugin (#2385)
上级
6aefdc42
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
342 addition
and
3 deletion
+342
-3
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceCLRGC.java
...ywalking/oap/server/core/source/ServiceInstanceCLRGC.java
+3
-3
oap-server/server-receiver-plugin/pom.xml
oap-server/server-receiver-plugin/pom.xml
+1
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/pom.xml
...er-receiver-plugin/skywalking-clr-receiver-plugin/pom.xml
+40
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/module/CLRModule.java
.../skywalking/oap/server/receiver/clr/module/CLRModule.java
+35
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/CLRModuleProvider.java
...g/oap/server/receiver/clr/provider/CLRModuleProvider.java
+65
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/handler/CLRMetricReportServiceHandler.java
...r/clr/provider/handler/CLRMetricReportServiceHandler.java
+59
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/handler/CLRSourceDispatcher.java
...er/receiver/clr/provider/handler/CLRSourceDispatcher.java
+97
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine
....apache.skywalking.oap.server.library.module.ModuleDefine
+19
-0
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
...pache.skywalking.oap.server.library.module.ModuleProvider
+19
-0
oap-server/server-starter/src/main/assembly/application.yml
oap-server/server-starter/src/main/assembly/application.yml
+2
-0
oap-server/server-starter/src/main/resources/application.yml
oap-server/server-starter/src/main/resources/application.yml
+2
-0
未找到文件。
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceCLRGC.java
浏览文件 @
7047c97e
...
...
@@ -40,8 +40,8 @@ public class ServiceInstanceCLRGC extends Source {
@Getter
@Setter
private
String
name
;
@Getter
@Setter
private
String
serviceName
;
@Getter
@Setter
private
int
serviceId
;
@Getter
@Setter
private
int
gen0CollectCount
;
@Getter
@Setter
private
int
gen1CollectCount
;
@Getter
@Setter
private
int
gen2CollectCount
;
@Getter
@Setter
private
long
gen0CollectCount
;
@Getter
@Setter
private
long
gen1CollectCount
;
@Getter
@Setter
private
long
gen2CollectCount
;
@Getter
@Setter
private
long
heapMemory
;
}
\ No newline at end of file
oap-server/server-receiver-plugin/pom.xml
浏览文件 @
7047c97e
...
...
@@ -36,6 +36,7 @@
<module>
skywalking-jvm-receiver-plugin
</module>
<module>
envoy-metrics-receiver-plugin
</module>
<module>
skywalking-sharing-server-plugin
</module>
<module>
skywalking-clr-receiver-plugin
</module>
</modules>
<dependencies>
...
...
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/pom.xml
0 → 100644
浏览文件 @
7047c97e
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
server-receiver-plugin
</artifactId>
<groupId>
org.apache.skywalking
</groupId>
<version>
6.1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
skywalking-clr-receiver-plugin
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.apache.skywalking
</groupId>
<artifactId>
skywalking-sharing-server-plugin
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/module/CLRModule.java
0 → 100644
浏览文件 @
7047c97e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.oap.server.receiver.clr.module
;
import
org.apache.skywalking.oap.server.library.module.ModuleDefine
;
/**
* @author liuhaoyang
**/
public
class
CLRModule
extends
ModuleDefine
{
public
CLRModule
()
{
super
(
"receiver-clr"
);
}
@Override
public
Class
[]
services
()
{
return
new
Class
[
0
];
}
}
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/CLRModuleProvider.java
0 → 100644
浏览文件 @
7047c97e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.oap.server.receiver.clr.provider
;
import
org.apache.skywalking.oap.server.core.CoreModule
;
import
org.apache.skywalking.oap.server.core.server.GRPCHandlerRegister
;
import
org.apache.skywalking.oap.server.library.module.ModuleConfig
;
import
org.apache.skywalking.oap.server.library.module.ModuleDefine
;
import
org.apache.skywalking.oap.server.library.module.ModuleProvider
;
import
org.apache.skywalking.oap.server.library.module.ModuleStartException
;
import
org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException
;
import
org.apache.skywalking.oap.server.receiver.clr.module.CLRModule
;
import
org.apache.skywalking.oap.server.receiver.clr.provider.handler.CLRMetricReportServiceHandler
;
import
org.apache.skywalking.oap.server.receiver.sharing.server.SharingServerModule
;
/**
* @author liuhaoyang
**/
public
class
CLRModuleProvider
extends
ModuleProvider
{
@Override
public
String
name
()
{
return
"default"
;
}
@Override
public
Class
<?
extends
ModuleDefine
>
module
()
{
return
CLRModule
.
class
;
}
@Override
public
ModuleConfig
createConfigBeanIfAbsent
()
{
return
null
;
}
@Override
public
void
prepare
()
throws
ServiceNotProvidedException
,
ModuleStartException
{
}
@Override
public
void
start
()
throws
ServiceNotProvidedException
,
ModuleStartException
{
GRPCHandlerRegister
grpcHandlerRegister
=
getManager
().
find
(
SharingServerModule
.
NAME
).
provider
().
getService
(
GRPCHandlerRegister
.
class
);
grpcHandlerRegister
.
addHandler
(
new
CLRMetricReportServiceHandler
(
getManager
()));
}
@Override
public
void
notifyAfterCompleted
()
throws
ServiceNotProvidedException
,
ModuleStartException
{
}
@Override
public
String
[]
requiredModules
()
{
return
new
String
[]
{
CoreModule
.
NAME
,
SharingServerModule
.
NAME
};
}
}
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/handler/CLRMetricReportServiceHandler.java
0 → 100644
浏览文件 @
7047c97e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.oap.server.receiver.clr.provider.handler
;
import
io.grpc.stub.StreamObserver
;
import
org.apache.skywalking.apm.network.common.Commands
;
import
org.apache.skywalking.apm.network.language.agent.v2.CLRMetricCollection
;
import
org.apache.skywalking.apm.network.language.agent.v2.CLRMetricReportServiceGrpc
;
import
org.apache.skywalking.oap.server.library.module.ModuleManager
;
import
org.apache.skywalking.oap.server.library.server.grpc.GRPCHandler
;
import
org.apache.skywalking.oap.server.library.util.TimeBucketUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author liuhaoyang
**/
public
class
CLRMetricReportServiceHandler
extends
CLRMetricReportServiceGrpc
.
CLRMetricReportServiceImplBase
implements
GRPCHandler
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CLRMetricReportServiceHandler
.
class
);
private
final
CLRSourceDispatcher
clrSourceDispatcher
;
public
CLRMetricReportServiceHandler
(
ModuleManager
moduleManager
)
{
clrSourceDispatcher
=
new
CLRSourceDispatcher
(
moduleManager
);
}
@Override
public
void
collect
(
CLRMetricCollection
request
,
StreamObserver
<
Commands
>
responseObserver
)
{
int
serviceInstanceId
=
request
.
getServiceInstanceId
();
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"receive the clr metric from service instance, id: {}"
,
serviceInstanceId
);
}
request
.
getMetricsList
().
forEach
(
metric
->
{
long
minuteTimeBucket
=
TimeBucketUtils
.
INSTANCE
.
getMinuteTimeBucket
(
metric
.
getTime
());
clrSourceDispatcher
.
sendMetric
(
serviceInstanceId
,
minuteTimeBucket
,
metric
);
});
responseObserver
.
onNext
(
Commands
.
newBuilder
().
build
());
responseObserver
.
onCompleted
();
}
}
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/clr/provider/handler/CLRSourceDispatcher.java
0 → 100644
浏览文件 @
7047c97e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.oap.server.receiver.clr.provider.handler
;
import
org.apache.skywalking.apm.network.common.CPU
;
import
org.apache.skywalking.apm.network.language.agent.CLRMetric
;
import
org.apache.skywalking.apm.network.language.agent.ClrGC
;
import
org.apache.skywalking.apm.network.language.agent.ClrThread
;
import
org.apache.skywalking.oap.server.core.Const
;
import
org.apache.skywalking.oap.server.core.CoreModule
;
import
org.apache.skywalking.oap.server.core.cache.ServiceInstanceInventoryCache
;
import
org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory
;
import
org.apache.skywalking.oap.server.core.source.ServiceInstanceCLRCPU
;
import
org.apache.skywalking.oap.server.core.source.ServiceInstanceCLRGC
;
import
org.apache.skywalking.oap.server.core.source.ServiceInstanceCLRThread
;
import
org.apache.skywalking.oap.server.core.source.SourceReceiver
;
import
org.apache.skywalking.oap.server.library.module.ModuleManager
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author liuhaoyang
**/
public
class
CLRSourceDispatcher
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CLRSourceDispatcher
.
class
);
private
final
SourceReceiver
sourceReceiver
;
private
final
ServiceInstanceInventoryCache
instanceInventoryCache
;
public
CLRSourceDispatcher
(
ModuleManager
moduleManager
)
{
sourceReceiver
=
moduleManager
.
find
(
CoreModule
.
NAME
).
provider
().
getService
(
SourceReceiver
.
class
);
instanceInventoryCache
=
moduleManager
.
find
(
CoreModule
.
NAME
).
provider
().
getService
(
ServiceInstanceInventoryCache
.
class
);
}
void
sendMetric
(
int
serviceInstanceId
,
long
minuteTimeBucket
,
CLRMetric
metric
)
{
ServiceInstanceInventory
serviceInstanceInventory
=
instanceInventoryCache
.
get
(
serviceInstanceId
);
int
serviceId
;
if
(
serviceInstanceInventory
==
null
)
{
serviceId
=
serviceInstanceInventory
.
getServiceId
();
}
else
{
logger
.
warn
(
"Can't found service by service instance id from cache, service instance id is: {}"
,
serviceInstanceId
);
return
;
}
CPU
cpu
=
metric
.
getCpu
();
ServiceInstanceCLRCPU
serviceInstanceCLRCPU
=
new
ServiceInstanceCLRCPU
();
serviceInstanceCLRCPU
.
setUsePercent
(
cpu
.
getUsagePercent
());
serviceInstanceCLRCPU
.
setTimeBucket
(
minuteTimeBucket
);
serviceInstanceCLRCPU
.
setId
(
serviceInstanceId
);
serviceInstanceCLRCPU
.
setName
(
Const
.
EMPTY_STRING
);
serviceInstanceCLRCPU
.
setServiceId
(
serviceId
);
serviceInstanceCLRCPU
.
setServiceName
(
Const
.
EMPTY_STRING
);
sourceReceiver
.
receive
(
serviceInstanceCLRCPU
);
ClrGC
gc
=
metric
.
getGc
();
ServiceInstanceCLRGC
serviceInstanceCLRGC
=
new
ServiceInstanceCLRGC
();
serviceInstanceCLRGC
.
setGen0CollectCount
(
gc
.
getGen0CollectCount
());
serviceInstanceCLRGC
.
setGen1CollectCount
(
gc
.
getGen1CollectCount
());
serviceInstanceCLRGC
.
setGen2CollectCount
(
gc
.
getGen2CollectCount
());
serviceInstanceCLRGC
.
setHeapMemory
(
gc
.
getHeapMemory
());
serviceInstanceCLRGC
.
setTimeBucket
(
minuteTimeBucket
);
serviceInstanceCLRGC
.
setId
(
serviceInstanceId
);
serviceInstanceCLRGC
.
setName
(
Const
.
EMPTY_STRING
);
serviceInstanceCLRGC
.
setServiceId
(
serviceId
);
serviceInstanceCLRGC
.
setServiceName
(
Const
.
EMPTY_STRING
);
sourceReceiver
.
receive
(
serviceInstanceCLRGC
);
ClrThread
thread
=
metric
.
getThread
();
ServiceInstanceCLRThread
serviceInstanceCLRThread
=
new
ServiceInstanceCLRThread
();
serviceInstanceCLRThread
.
setAvailableCompletionPortThreads
(
thread
.
getAvailableCompletionPortThreads
());
serviceInstanceCLRThread
.
setAvailableWorkerThreads
(
thread
.
getAvailableWorkerThreads
());
serviceInstanceCLRThread
.
setMaxCompletionPortThreads
(
thread
.
getMaxCompletionPortThreads
());
serviceInstanceCLRThread
.
setMaxWorkerThreads
(
thread
.
getMaxWorkerThreads
());
serviceInstanceCLRThread
.
setTimeBucket
(
minuteTimeBucket
);
serviceInstanceCLRThread
.
setId
(
serviceInstanceId
);
serviceInstanceCLRThread
.
setName
(
Const
.
EMPTY_STRING
);
serviceInstanceCLRThread
.
setServiceId
(
serviceId
);
serviceInstanceCLRThread
.
setServiceName
(
Const
.
EMPTY_STRING
);
sourceReceiver
.
receive
(
serviceInstanceCLRThread
);
}
}
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine
0 → 100644
浏览文件 @
7047c97e
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
org.apache.skywalking.oap.server.receiver.clr.module.CLRModule
\ No newline at end of file
oap-server/server-receiver-plugin/skywalking-clr-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
0 → 100644
浏览文件 @
7047c97e
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
org.apache.skywalking.oap.server.receiver.clr.provider.CLRModuleProvider
\ No newline at end of file
oap-server/server-starter/src/main/assembly/application.yml
浏览文件 @
7047c97e
...
...
@@ -84,6 +84,8 @@ receiver-trace:
slowDBAccessThreshold
:
${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100}
# The slow database access thresholds. Unit ms.
receiver-jvm
:
default
:
receiver-clr
:
default
:
service-mesh
:
default
:
bufferPath
:
${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}
# Path to trace buffer files, suggest to use absolute path
...
...
oap-server/server-starter/src/main/resources/application.yml
浏览文件 @
7047c97e
...
...
@@ -84,6 +84,8 @@ receiver-trace:
slowDBAccessThreshold
:
${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100}
# The slow database access thresholds. Unit ms.
receiver-jvm
:
default
:
receiver-clr
:
default
:
service-mesh
:
default
:
bufferPath
:
${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}
# Path to trace buffer files, suggest to use absolute path
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录