Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gdyjdao
SkyWalking
提交
726d1d6b
S
SkyWalking
项目概览
gdyjdao
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / 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,发现更多精彩内容 >>
提交
726d1d6b
编写于
11月 16, 2017
作者:
L
lytscu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Comments
上级
1182e8a9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
13 deletion
+24
-13
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java
...plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java
+1
-2
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/define/MongoDBCollectionImplInstrumentation.java
...ngodb/v2/define/MongoDBCollectionImplInstrumentation.java
+10
-3
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/define/MongoDBCollectionInstrumentation.java
...n/mongodb/v2/define/MongoDBCollectionInstrumentation.java
+13
-8
未找到文件。
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java
浏览文件 @
726d1d6b
...
...
@@ -37,8 +37,7 @@ import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptR
import
org.skywalking.apm.network.trace.component.ComponentsDefine
;
/**
* {@link MongoDBCollectionMethodInterceptor} intercept method of {@link com.mongodb.DBCollection#find()}
* or{@link com.mongodb.DBCollectionImpl#insert}.... record the mongoDB host, operation name ...
* {@link MongoDBCollectionMethodInterceptor} intercept {@link com.mongodb.DBCollectionImpl}{@link com.mongodb.DBCollection}class
*/
public
class
MongoDBCollectionMethodInterceptor
implements
InstanceMethodsAroundInterceptor
,
InstanceConstructorInterceptor
{
...
...
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/define/MongoDBCollectionImplInstrumentation.java
浏览文件 @
726d1d6b
...
...
@@ -31,9 +31,16 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import
static
org
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* {@link MongoDBCollectionImplInstrumentation} presents that skywalking intercepts {@link
* com.mongodb.DBCollection#find()}, {@link com.mongodb.DBCollection#createIndex} by using {@link
* MongoDBCollectionMethodInterceptor}.
* {@link MongoDBCollectionImplInstrumentation} define that the MongoDB Java Driver 2.13.x-2.14.x plugin intercepts the following methods in the
* {@link com.mongodb.DBCollectionImpl}class:
* 1. find <br/>
* 2. insert <br/>
* 3. insertImpl <br/>
* 4. update <br/>
* 5. updateImpl <br/>
* 6. remove <br/>
* 7. createIndex <br/>
*
*/
public
class
MongoDBCollectionImplInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/skywalking/apm/plugin/mongodb/v2/define/MongoDBCollectionInstrumentation.java
浏览文件 @
726d1d6b
...
...
@@ -31,9 +31,20 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import
static
org
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
bytebuddy
.
ArgumentTypeNameMatch
.
takesArgumentWithType
;
import
static
org
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
match
.
NameMatch
.
byName
;
/**
* {@link MongoDBCollectionInstrumentation} presents that skywalking intercepts {@link com.mongodb.DBCollection#getCount()},
* {@link com.mongodb.DBCollection#mapReduce} by using {@link MongoDBCollectionMethodInterceptor}.
* {@link MongoDBCollectionInstrumentation} define that the MongoDB Java Driver 2.13.x-2.14.x plugin intercepts the following methods in the
* {@link com.mongodb.DBCollection}class:
* 1. aggregate <br/>
* 2. findAndModify <br/>
* 3. getCount <br/>
* 4. drop <br/>
* 5. dropIndexes <br/>
* 6. rename <br/>
* 7. group <br/>
* 8. distinct <br/>
* 9. mapReduce <br/>
*
*/
public
class
MongoDBCollectionInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
@@ -136,12 +147,6 @@ public class MongoDBCollectionInstrumentation extends ClassInstanceMethodsEnhanc
return
named
(
"mapReduce"
).
and
(
takesArgumentWithType
(
0
,
"com.mongodb.DBObject"
));
}
},
new
InterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
"aggregate"
).
and
(
takesArgumentWithType
(
1
,
"com.mongodb.ReadPreference"
));
}
},
new
InterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录