Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SkyAPM
SkyAPM-php-sdk
提交
61d323d3
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 搜索 >>
提交
61d323d3
编写于
4月 08, 2019
作者:
G
goerzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
write uuid to log
上级
c5fefa06
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
5 deletion
+13
-5
skywalking.c
skywalking.c
+2
-0
src/greeter_client.cc
src/greeter_client.cc
+11
-5
未找到文件。
skywalking.c
浏览文件 @
61d323d3
...
...
@@ -68,6 +68,7 @@ static int application_instance = 0;
static
int
application_id
=
0
;
static
int
sky_close
=
0
;
static
int
sky_increment_id
=
0
;
char
*
uuid
=
NULL
;
/* {{{ PHP_INI
*/
...
...
@@ -706,6 +707,7 @@ static void request_init() {
add_assoc_long
(
&
SKYWALKING_G
(
UpstreamSegment
),
"pid"
,
getppid
());
add_assoc_long
(
&
SKYWALKING_G
(
UpstreamSegment
),
"application_id"
,
application_id
);
add_assoc_long
(
&
SKYWALKING_G
(
UpstreamSegment
),
"version"
,
SKYWALKING_G
(
version
));
add_assoc_string
(
&
SKYWALKING_G
(
UpstreamSegment
),
"uuid"
,
uuid
);
SKY_ADD_ASSOC_ZVAL
(
&
SKYWALKING_G
(
UpstreamSegment
),
"segment"
);
SKY_ADD_ASSOC_ZVAL
(
&
SKYWALKING_G
(
UpstreamSegment
),
"globalTraceIds"
);
...
...
src/greeter_client.cc
浏览文件 @
61d323d3
...
...
@@ -45,8 +45,8 @@ extern "C" void networkAddressRegister();
extern
"C"
void
endpointRegister
();
static
boost
::
uuids
::
uuid
uuid
=
boost
::
uuids
::
random_generator
()();
extern
char
*
uuid
;
static
boost
::
uuids
::
uuid
boost_
uuid
=
boost
::
uuids
::
random_generator
()();
class
GreeterClient
{
public:
...
...
@@ -84,9 +84,15 @@ public:
ServiceInstances
request
;
ServiceInstance
*
s
=
request
.
add_instances
();
if
(
uuid
==
NULL
)
{
std
::
string
uuid_str
=
boost
::
uuids
::
to_string
(
boost_uuid
);
uuid
=
(
char
*
)
malloc
(
uuid_str
.
size
()
+
1
);
bzero
(
uuid
,
uuid_str
.
size
()
+
1
);
strncpy
(
uuid
,
uuid_str
.
c_str
(),
uuid_str
.
size
()
+
1
);
}
s
->
set_serviceid
(
applicationid
);
s
->
set_instanceuuid
(
boost
::
uuids
::
to_
string
(
uuid
));
s
->
set_instanceuuid
(
std
::
string
(
uuid
));
s
->
set_time
(
registertime
);
KeyStringValuePair
*
os
=
s
->
add_properties
();
...
...
@@ -120,8 +126,8 @@ public:
std
::
cout
<<
"Register Instance:"
<<
std
::
endl
;
std
::
cout
<<
kv
.
key
()
<<
": "
<<
kv
.
value
()
<<
std
::
endl
;
if
(
kv
.
key
()
==
boost
::
uuids
::
to_string
(
uuid
)
)
{
std
::
cout
<<
"uuid"
<<
": "
<<
boost
::
uuids
::
to_string
(
uuid
)
<<
std
::
endl
;
if
(
kv
.
key
()
==
uuid
)
{
std
::
cout
<<
"uuid"
<<
": "
<<
uuid
<<
std
::
endl
;
return
kv
.
value
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录