Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
59df33de
S
SkyAPM-php-sdk
项目概览
SkyAPM
/
SkyAPM-php-sdk
通知
14
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyAPM-php-sdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
59df33de
编写于
8月 05, 2019
作者:
何
何延龙
提交者:
GitHub
8月 05, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #103 from bostin/feature/add_grpc_support
Add Grpc support
上级
d03edee2
58c4789b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
1 deletion
+27
-1
README.md
README.md
+1
-0
docs/zh/qa.md
docs/zh/qa.md
+1
-0
skywalking.c
skywalking.c
+25
-1
未找到文件。
README.md
浏览文件 @
59df33de
...
...
@@ -23,6 +23,7 @@ Host in Beijing. Go to [demo](http://106.75.237.45:8080/).
1.
PDO
1.
Mysqli
1.
Yar Client (
[
Yar
](
https://www.php.net/manual/en/book.yar.php
)
)
1.
GRPC Client (
[
GRPC
](
https://github.com/grpc/grpc-php
)
)
1.
Predis Client (
[
Predis
](
https://packagist.org/packages/predis/predis
)
)
1.
Redis Extension (
[
Redis Extension
](
https://github.com/phpredis/phpredis
)
)
...
...
docs/zh/qa.md
浏览文件 @
59df33de
...
...
@@ -20,6 +20,7 @@
*
php PDO扩展发出的请求
*
php mysqli扩展发出的请求
*
php yar扩展(client)发出的请求
*
php
[
grpc/grpc
](
https://github.com/grpc/grpc-php
)
发出的请求
*
php redis扩展发出的请求
*
php predis库发出的请求
...
...
skywalking.c
浏览文件 @
59df33de
...
...
@@ -188,6 +188,7 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
const
char
*
function_name
=
zf
->
common
.
function_name
==
NULL
?
NULL
:
ZSTR_VAL
(
zf
->
common
.
function_name
);
char
*
operationName
=
NULL
;
int
componentId
=
0
;
if
(
class_name
!=
NULL
)
{
if
(
strcmp
(
class_name
,
"Predis
\\
Client"
)
==
0
&&
strcmp
(
function_name
,
"__call"
)
==
0
)
{
// params
...
...
@@ -197,11 +198,28 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
if
(
Z_TYPE_P
(
p
)
==
IS_STRING
)
{
operationName
=
(
char
*
)
emalloc
(
strlen
(
class_name
)
+
strlen
(
Z_STRVAL_P
(
p
))
+
3
);
componentId
=
COMPONENT_JEDIS
;
strcpy
(
operationName
,
class_name
);
strcat
(
operationName
,
"->"
);
strcat
(
operationName
,
Z_STRVAL_P
(
p
));
}
}
}
else
if
(
strcmp
(
class_name
,
"Grpc
\\
BaseStub"
)
==
0
)
{
if
(
strcmp
(
function_name
,
"_simpleRequest"
)
==
0
||
strcmp
(
function_name
,
"_clientStreamRequest"
)
==
0
||
strcmp
(
function_name
,
"_serverStreamRequest"
)
==
0
||
strcmp
(
function_name
,
"_bidiRequest"
)
==
0
)
{
operationName
=
(
char
*
)
emalloc
(
strlen
(
class_name
)
+
strlen
(
function_name
)
+
3
);
if
(
SKYWALKING_G
(
version
)
==
5
)
{
componentId
=
COMPONENT_GRPC
;
}
else
{
componentId
=
COMPONENT_RPC
;
}
strcpy
(
operationName
,
class_name
);
strcat
(
operationName
,
"->"
);
strcat
(
operationName
,
function_name
);
}
}
}
...
...
@@ -268,6 +286,12 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
}
}
}
}
else
if
(
strcmp
(
class_name
,
"Grpc
\\
BaseStub"
)
==
0
)
{
add_assoc_string
(
&
tags
,
"rpc.type"
,
"grpc"
);
zval
*
p
=
ZEND_CALL_ARG
(
execute_data
,
1
);
if
(
Z_TYPE_P
(
p
)
==
IS_STRING
)
{
add_assoc_string
(
&
tags
,
"rpc.method"
,
Z_STRVAL_P
(
p
));
}
}
zval
temp
;
...
...
@@ -289,7 +313,7 @@ ZEND_API void sky_execute_ex(zend_execute_data *execute_data) {
add_assoc_long
(
&
temp
,
"startTime"
,
millisecond
);
add_assoc_long
(
&
temp
,
"spanType"
,
1
);
add_assoc_long
(
&
temp
,
"spanLayer"
,
1
);
add_assoc_long
(
&
temp
,
"componentId"
,
COMPONENT_JEDIS
);
add_assoc_long
(
&
temp
,
"componentId"
,
componentId
);
add_assoc_string
(
&
temp
,
"operationName"
,
operationName
);
add_assoc_string
(
&
temp
,
"peer"
,
""
);
efree
(
operationName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录