Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ec39704f
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ec39704f
编写于
9月 05, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 05, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23926 【monthly0815分支挑单】编码风格保持一致,语句结束加上分号。
Merge pull request !23926 from honghecun/cherry-pick-1693901490
上级
c1afd548
2debd58b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
22 deletion
+22
-22
zh-cn/application-dev/dfx/hitracechain-guidelines.md
zh-cn/application-dev/dfx/hitracechain-guidelines.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-hisysevent.md
zh-cn/application-dev/reference/apis/js-apis-hisysevent.md
+20
-20
未找到文件。
zh-cn/application-dev/dfx/hitracechain-guidelines.md
浏览文件 @
ec39704f
...
@@ -57,13 +57,13 @@ hiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务
...
@@ -57,13 +57,13 @@ hiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务
'PACKAGE_NAME': "com.demo.hitracechain",
'PACKAGE_NAME': "com.demo.hitracechain",
'PROCESS_NAME': "hitracechaindemo",
'PROCESS_NAME': "hitracechaindemo",
'MSG': "no msg."
'MSG': "no msg."
}
}
;
let eventInfo: hiSysEvent.SysEventInfo = {
let eventInfo: hiSysEvent.SysEventInfo = {
domain: "RELIABILITY",
domain: "RELIABILITY",
name: "STACK",
name: "STACK",
eventType: hiSysEvent.EventType.FAULT,
eventType: hiSysEvent.EventType.FAULT,
params: customizedParams
params: customizedParams
}
}
;
hiSysEvent.write(eventInfo).then((val: number) => {
hiSysEvent.write(eventInfo).then((val: number) => {
console.info(`write result is ${val}`);
console.info(`write result is ${val}`);
// 业务结束,关闭分布式跟踪。
// 业务结束,关闭分布式跟踪。
...
...
zh-cn/application-dev/reference/apis/js-apis-hisysevent.md
浏览文件 @
ec39704f
...
@@ -163,7 +163,7 @@ try {
...
@@ -163,7 +163,7 @@ try {
(
err
:
BusinessError
)
=>
{
(
err
:
BusinessError
)
=>
{
console
.
error
(
`error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
);
console
.
error
(
`error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
);
}
}
)
)
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -251,9 +251,9 @@ let watcher: hiSysEvent.Watcher = {
...
@@ -251,9 +251,9 @@ let watcher: hiSysEvent.Watcher = {
onServiceDied
:
()
=>
{
onServiceDied
:
()
=>
{
// do something here.
// do something here.
}
}
}
}
;
try
{
try
{
hiSysEvent
.
addWatcher
(
watcher
)
hiSysEvent
.
addWatcher
(
watcher
)
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -294,7 +294,7 @@ let watchRules: hiSysEvent.WatchRule[] = [{
...
@@ -294,7 +294,7 @@ let watchRules: hiSysEvent.WatchRule[] = [{
name
:
"
STACK
"
,
name
:
"
STACK
"
,
tag
:
"
STABILITY
"
,
tag
:
"
STABILITY
"
,
ruleType
:
hiSysEvent
.
RuleType
.
WHOLE_WORD
,
ruleType
:
hiSysEvent
.
RuleType
.
WHOLE_WORD
,
}
as
hiSysEvent
.
WatchRule
]
}
as
hiSysEvent
.
WatchRule
]
;
let
watcher
:
hiSysEvent
.
Watcher
=
{
let
watcher
:
hiSysEvent
.
Watcher
=
{
rules
:
watchRules
,
rules
:
watchRules
,
onEvent
:
(
info
:
hiSysEvent
.
SysEventInfo
)
=>
{
onEvent
:
(
info
:
hiSysEvent
.
SysEventInfo
)
=>
{
...
@@ -303,10 +303,10 @@ let watcher: hiSysEvent.Watcher = {
...
@@ -303,10 +303,10 @@ let watcher: hiSysEvent.Watcher = {
onServiceDied
:
()
=>
{
onServiceDied
:
()
=>
{
// do something here.
// do something here.
}
}
}
}
;
try
{
try
{
hiSysEvent
.
addWatcher
(
watcher
)
hiSysEvent
.
addWatcher
(
watcher
)
;
hiSysEvent
.
removeWatcher
(
watcher
)
hiSysEvent
.
removeWatcher
(
watcher
)
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -400,7 +400,7 @@ try {
...
@@ -400,7 +400,7 @@ try {
};
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
// do something here.
})
})
;
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
beginTime
:
-
1
,
beginTime
:
-
1
,
...
@@ -410,7 +410,7 @@ try {
...
@@ -410,7 +410,7 @@ try {
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
domain
:
"
RELIABILITY
"
,
domain
:
"
RELIABILITY
"
,
names
:
[
"
STACK
"
],
names
:
[
"
STACK
"
],
}
as
hiSysEvent
.
QueryRule
]
}
as
hiSysEvent
.
QueryRule
]
;
let
querier
:
hiSysEvent
.
Querier
=
{
let
querier
:
hiSysEvent
.
Querier
=
{
onQuery
:
(
infos
:
hiSysEvent
.
SysEventInfo
[])
=>
{
onQuery
:
(
infos
:
hiSysEvent
.
SysEventInfo
[])
=>
{
// do something here.
// do something here.
...
@@ -418,8 +418,8 @@ try {
...
@@ -418,8 +418,8 @@ try {
onComplete
:
(
reason
:
number
,
total
:
number
)
=>
{
onComplete
:
(
reason
:
number
,
total
:
number
)
=>
{
// do something here.
// do something here.
}
}
}
}
;
hiSysEvent
.
query
(
queryArg
,
queryRules
,
querier
)
hiSysEvent
.
query
(
queryArg
,
queryRules
,
querier
)
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -481,18 +481,18 @@ try {
...
@@ -481,18 +481,18 @@ try {
};
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
// do something here.
})
})
;
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
beginTime
:
-
1
,
beginTime
:
-
1
,
endTime
:
-
1
,
endTime
:
-
1
,
maxEvents
:
1
,
maxEvents
:
1
,
}
}
;
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
domain
:
"
RELIABILITY
"
,
domain
:
"
RELIABILITY
"
,
names
:
[
"
STACK
"
],
names
:
[
"
STACK
"
],
}
as
hiSysEvent
.
QueryRule
]
}
as
hiSysEvent
.
QueryRule
]
;
let
time
=
hiSysEvent
.
exportSysEvents
(
queryArg
,
queryRules
)
let
time
=
hiSysEvent
.
exportSysEvents
(
queryArg
,
queryRules
)
;
console
.
log
(
`receive export task time is :
${
time
}
`
);
console
.
log
(
`receive export task time is :
${
time
}
`
);
// 延迟读取本次导出的事件
// 延迟读取本次导出的事件
...
@@ -506,7 +506,7 @@ try {
...
@@ -506,7 +506,7 @@ try {
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
}
}
}
}
},
10000
)
},
10000
)
;
}
catch
catch
(
err
)
{
}
catch
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -559,7 +559,7 @@ try {
...
@@ -559,7 +559,7 @@ try {
domain
:
"
BUNDLE_MANAGER
"
,
domain
:
"
BUNDLE_MANAGER
"
,
names
:
[
"
BUNDLE_UNINSTALL
"
],
names
:
[
"
BUNDLE_UNINSTALL
"
],
}
as
hiSysEvent
.
QueryRule
];
}
as
hiSysEvent
.
QueryRule
];
hiSysEvent
.
subscribe
(
rules
)
hiSysEvent
.
subscribe
(
rules
)
;
let
customizedParams
:
Record
<
string
,
string
|
number
>
=
{
let
customizedParams
:
Record
<
string
,
string
|
number
>
=
{
'
PID
'
:
487
,
'
PID
'
:
487
,
...
@@ -576,7 +576,7 @@ try {
...
@@ -576,7 +576,7 @@ try {
};
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
// do something here.
})
})
;
// 延迟读取订阅的事件
// 延迟读取订阅的事件
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -587,7 +587,7 @@ try {
...
@@ -587,7 +587,7 @@ try {
let
events
:
string
=
JSON
.
parse
(
'
[
'
+
res
.
slice
(
0
,
res
.
length
-
1
)
+
'
]
'
);
let
events
:
string
=
JSON
.
parse
(
'
[
'
+
res
.
slice
(
0
,
res
.
length
-
1
)
+
'
]
'
);
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
}
}
},
10000
)
},
10000
)
;
}
catch
catch
(
err
)
{
}
catch
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
}
...
@@ -626,7 +626,7 @@ try {
...
@@ -626,7 +626,7 @@ try {
domain
:
"
BUNDLE_MANAGER
"
,
domain
:
"
BUNDLE_MANAGER
"
,
names
:
[
"
BUNDLE_UNINSTALL
"
],
names
:
[
"
BUNDLE_UNINSTALL
"
],
}
as
hiSysEvent
.
QueryRule
];
}
as
hiSysEvent
.
QueryRule
];
hiSysEvent
.
subscribe
(
rules
)
hiSysEvent
.
subscribe
(
rules
)
;
hiSysEvent
.
unsubscribe
();
hiSysEvent
.
unsubscribe
();
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录