Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
fab5a60e
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看板
提交
fab5a60e
编写于
9月 05, 2023
作者:
X
xuyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add semicolon at the end of each sentence.
Signed-off-by:
N
xuyong
<
xuyong59@huawei.com
>
上级
7406c993
变更
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
浏览文件 @
fab5a60e
...
...
@@ -57,13 +57,13 @@ hiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务
'PACKAGE_NAME': "com.demo.hitracechain",
'PROCESS_NAME': "hitracechaindemo",
'MSG': "no msg."
}
}
;
let eventInfo: hiSysEvent.SysEventInfo = {
domain: "RELIABILITY",
name: "STACK",
eventType: hiSysEvent.EventType.FAULT,
params: customizedParams
}
}
;
hiSysEvent.write(eventInfo).then((val: number) => {
console.info(`write result is ${val}`);
// 业务结束,关闭分布式跟踪。
...
...
zh-cn/application-dev/reference/apis/js-apis-hisysevent.md
浏览文件 @
fab5a60e
...
...
@@ -163,7 +163,7 @@ try {
(
err
:
BusinessError
)
=>
{
console
.
error
(
`error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
);
}
)
)
;
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -251,9 +251,9 @@ let watcher: hiSysEvent.Watcher = {
onServiceDied
:
()
=>
{
// do something here.
}
}
}
;
try
{
hiSysEvent
.
addWatcher
(
watcher
)
hiSysEvent
.
addWatcher
(
watcher
)
;
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -294,7 +294,7 @@ let watchRules: hiSysEvent.WatchRule[] = [{
name
:
"
STACK
"
,
tag
:
"
STABILITY
"
,
ruleType
:
hiSysEvent
.
RuleType
.
WHOLE_WORD
,
}
as
hiSysEvent
.
WatchRule
]
}
as
hiSysEvent
.
WatchRule
]
;
let
watcher
:
hiSysEvent
.
Watcher
=
{
rules
:
watchRules
,
onEvent
:
(
info
:
hiSysEvent
.
SysEventInfo
)
=>
{
...
...
@@ -303,10 +303,10 @@ let watcher: hiSysEvent.Watcher = {
onServiceDied
:
()
=>
{
// do something here.
}
}
}
;
try
{
hiSysEvent
.
addWatcher
(
watcher
)
hiSysEvent
.
removeWatcher
(
watcher
)
hiSysEvent
.
addWatcher
(
watcher
)
;
hiSysEvent
.
removeWatcher
(
watcher
)
;
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -400,7 +400,7 @@ try {
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
})
})
;
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
beginTime
:
-
1
,
...
...
@@ -410,7 +410,7 @@ try {
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
domain
:
"
RELIABILITY
"
,
names
:
[
"
STACK
"
],
}
as
hiSysEvent
.
QueryRule
]
}
as
hiSysEvent
.
QueryRule
]
;
let
querier
:
hiSysEvent
.
Querier
=
{
onQuery
:
(
infos
:
hiSysEvent
.
SysEventInfo
[])
=>
{
// do something here.
...
...
@@ -418,8 +418,8 @@ try {
onComplete
:
(
reason
:
number
,
total
:
number
)
=>
{
// do something here.
}
}
hiSysEvent
.
query
(
queryArg
,
queryRules
,
querier
)
}
;
hiSysEvent
.
query
(
queryArg
,
queryRules
,
querier
)
;
}
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -481,18 +481,18 @@ try {
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
})
})
;
let
queryArg
:
hiSysEvent
.
QueryArg
=
{
beginTime
:
-
1
,
endTime
:
-
1
,
maxEvents
:
1
,
}
}
;
let
queryRules
:
hiSysEvent
.
QueryRule
[]
=
[{
domain
:
"
RELIABILITY
"
,
names
:
[
"
STACK
"
],
}
as
hiSysEvent
.
QueryRule
]
let
time
=
hiSysEvent
.
exportSysEvents
(
queryArg
,
queryRules
)
}
as
hiSysEvent
.
QueryRule
]
;
let
time
=
hiSysEvent
.
exportSysEvents
(
queryArg
,
queryRules
)
;
console
.
log
(
`receive export task time is :
${
time
}
`
);
// 延迟读取本次导出的事件
...
...
@@ -506,7 +506,7 @@ try {
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
}
}
},
10000
)
},
10000
)
;
}
catch
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -559,7 +559,7 @@ try {
domain
:
"
BUNDLE_MANAGER
"
,
names
:
[
"
BUNDLE_UNINSTALL
"
],
}
as
hiSysEvent
.
QueryRule
];
hiSysEvent
.
subscribe
(
rules
)
hiSysEvent
.
subscribe
(
rules
)
;
let
customizedParams
:
Record
<
string
,
string
|
number
>
=
{
'
PID
'
:
487
,
...
...
@@ -576,7 +576,7 @@ try {
};
hiSysEvent
.
write
(
eventInfo
,
(
err
:
BusinessError
,
val
:
number
)
=>
{
// do something here.
})
})
;
// 延迟读取订阅的事件
setTimeout
(()
=>
{
...
...
@@ -587,7 +587,7 @@ try {
let
events
:
string
=
JSON
.
parse
(
'
[
'
+
res
.
slice
(
0
,
res
.
length
-
1
)
+
'
]
'
);
console
.
log
(
"
read file end, events is :
"
+
JSON
.
stringify
(
events
));
}
},
10000
)
},
10000
)
;
}
catch
catch
(
err
)
{
console
.
error
(
`error code:
${(
err
as
BusinessError
).
code
}
, error msg:
${(
err
as
BusinessError
).
message
}
`
);
}
...
...
@@ -626,7 +626,7 @@ try {
domain
:
"
BUNDLE_MANAGER
"
,
names
:
[
"
BUNDLE_UNINSTALL
"
],
}
as
hiSysEvent
.
QueryRule
];
hiSysEvent
.
subscribe
(
rules
)
hiSysEvent
.
subscribe
(
rules
)
;
hiSysEvent
.
unsubscribe
();
}
catch
(
err
)
{
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录