Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
c5fefa06
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 搜索 >>
提交
c5fefa06
编写于
4月 08, 2019
作者:
G
goerzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix function name
上级
e59e8f66
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
18 deletion
+23
-18
skywalking.c
skywalking.c
+7
-7
src/greeter_client.cc
src/greeter_client.cc
+16
-11
未找到文件。
skywalking.c
浏览文件 @
c5fefa06
...
...
@@ -53,10 +53,10 @@
#include "b64.h"
extern
int
applicationCod
eRegister
(
char
*
grpc_server
,
char
*
code
);
extern
int
servic
eRegister
(
char
*
grpc_server
,
char
*
code
);
extern
int
registerInstance
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
);
extern
int
serviceInstanceRegister
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
);
/* If you declare any globals in php_skywalking.h uncomment this:
*/
...
...
@@ -819,7 +819,7 @@ static void module_init() {
int
i
=
0
;
do
{
application_id
=
applicationCod
eRegister
(
SKYWALKING_G
(
grpc
),
SKYWALKING_G
(
app_code
));
application_id
=
servic
eRegister
(
SKYWALKING_G
(
grpc
),
SKYWALKING_G
(
app_code
));
if
(
application_id
==
-
100000
)
{
sleep
(
1
);
...
...
@@ -846,9 +846,9 @@ static void module_init() {
i
=
0
;
do
{
application_instance
=
registerInstance
(
SKYWALKING_G
(
grpc
),
application_id
,
millisecond
,
SKY_OS_NAME
,
hostname
,
getpid
(),
ipv4s
);
application_instance
=
serviceInstanceRegister
(
SKYWALKING_G
(
grpc
),
application_id
,
millisecond
,
SKY_OS_NAME
,
hostname
,
getpid
(),
ipv4s
);
if
(
application_instance
==
-
100000
)
{
sleep
(
1
);
}
...
...
src/greeter_client.cc
浏览文件 @
c5fefa06
...
...
@@ -35,11 +35,16 @@ using grpc::ClientReaderWriter;
using
grpc
::
ClientWriter
;
extern
"C"
int
applicationCod
eRegister
(
char
*
grpc_server
,
char
*
service_name
);
extern
"C"
int
servic
eRegister
(
char
*
grpc_server
,
char
*
service_name
);
extern
"C"
int
registerInstance
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
);
serviceInstanceRegister
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
);
extern
"C"
void
networkAddressRegister
();
extern
"C"
void
endpointRegister
();
static
boost
::
uuids
::
uuid
uuid
=
boost
::
uuids
::
random_generator
()();
...
...
@@ -48,7 +53,7 @@ public:
GreeterClient
(
std
::
shared_ptr
<
Channel
>
channel
)
:
stub_
(
Register
::
NewStub
(
channel
))
{}
int
applicationCod
eRegister
(
const
std
::
string
&
service_name
)
{
int
servic
eRegister
(
const
std
::
string
&
service_name
)
{
Services
request
;
Service
*
s
=
request
.
add_services
();
...
...
@@ -74,8 +79,8 @@ public:
return
-
100000
;
}
int
registerInstance
(
int
applicationid
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
)
{
int
serviceInstanceRegister
(
int
applicationid
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
)
{
ServiceInstances
request
;
ServiceInstance
*
s
=
request
.
add_instances
();
...
...
@@ -131,17 +136,17 @@ private:
};
int
applicationCod
eRegister
(
char
*
grpc_server
,
char
*
service_name
)
{
int
servic
eRegister
(
char
*
grpc_server
,
char
*
service_name
)
{
GreeterClient
greeter
(
grpc
::
CreateChannel
(
grpc_server
,
grpc
::
InsecureChannelCredentials
()));
std
::
string
c
(
service_name
);
return
greeter
.
applicationCod
eRegister
(
c
);
return
greeter
.
servic
eRegister
(
c
);
}
int
registerInstance
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
)
{
serviceInstanceRegister
(
char
*
grpc_server
,
int
appId
,
long
registertime
,
char
*
osname
,
char
*
hostname
,
int
processno
,
char
*
ipv4s
)
{
GreeterClient
greeter
(
grpc
::
CreateChannel
(
grpc_server
,
grpc
::
InsecureChannelCredentials
()));
return
greeter
.
registerInstance
(
appId
,
registertime
,
osname
,
hostname
,
processno
,
ipv4s
);
return
greeter
.
serviceInstanceRegister
(
appId
,
registertime
,
osname
,
hostname
,
processno
,
ipv4s
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录