Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
9bfd5485
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9bfd5485
编写于
4月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3463 Mark coding language type in markdown file.
Merge pull request !3463 from honghecun/master
上级
97616189
5822bddf
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
34 addition
and
34 deletion
+34
-34
en/application-dev/reference/apis/js-apis-hitracechain.md
en/application-dev/reference/apis/js-apis-hitracechain.md
+11
-11
en/application-dev/reference/apis/js-apis-hitracemeter.md
en/application-dev/reference/apis/js-apis-hitracemeter.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-hitracechain.md
zh-cn/application-dev/reference/apis/js-apis-hitracechain.md
+11
-11
zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md
zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md
+6
-6
未找到文件。
en/application-dev/reference/apis/js-apis-hitracechain.md
浏览文件 @
9bfd5485
...
...
@@ -5,7 +5,7 @@
## Modules to Import
```
```
javascript
import
hiTraceChain
from
'
@ohos.hiTraceChain
'
;
```
...
...
@@ -90,7 +90,7 @@ Starts call chain tracing. This API works in synchronous manner.
**Example**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
|
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
```
...
...
@@ -110,7 +110,7 @@ Stops call chain tracing. This API works in synchronous manner.
**Example**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
);
// End the call chain tracing after the service logic is executed for several times.
hiTraceChain
.
end
(
asyncTraceId
);
...
...
@@ -132,7 +132,7 @@ Obtains the trace ID. This API works in synchronous manner.
**Example**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// Obtain the current trace ID after the service logic is executed for several times.
let
curTraceId
=
hiTraceChain
.
getId
();
...
...
@@ -154,7 +154,7 @@ Sets a trace ID. This API works in synchronous manner.
**Example**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// Set the current trace ID after the service logic is executed for several times.
hiTraceChain
.
setId
(
asyncTraceId
);
...
...
@@ -170,7 +170,7 @@ Clears the trace ID. This API works in synchronous manner.
**Example**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// Clear the current trace ID after the service logic is executed for several times.
hiTraceChain
.
clearId
();
...
...
@@ -192,7 +192,7 @@ Creates a trace span. This API works in synchronous manner.
**Example**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// Create a trace span after the service logic is executed for several times.
let
spanTraceId
=
hiTraceChain
.
createSpan
();
...
...
@@ -217,7 +217,7 @@ Triggers a trace point. This API works in synchronous manner.
**Example**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
|
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
// Trigger the trace point after the service logic is executed for several times.
hiTraceChain
.
tracepoint
(
hiTraceChain
.
HiTraceCommunicationMode
.
THREAD
,
hiTraceChain
.
HiTraceTracepointType
.
SS
,
asyncTraceId
,
"
Just a example
"
);
...
...
@@ -245,7 +245,7 @@ Checks whether a **HiTraceId** instance is valid. This API works in synchronous
**Example**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
let
traceIdIsvalid
=
hiTraceChain
.
isValid
(
traceId
);
```
...
...
@@ -273,7 +273,7 @@ Checks whether the specified trace flag in the **HiTraceId** instance is enabled
**Example**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
// The value of enabledDoNotCreateSpanFlag is true.
let
enabledDoNotCreateSpanFlag
=
hiTraceChain
.
isFlagEnabled
(
asyncTraceId
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
...
...
@@ -295,7 +295,7 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i
**Example**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
hiTraceChain
.
enable
(
asyncTraceId
,
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
// The value of enabledDoNotCreateSpanFlag is true.
...
...
en/application-dev/reference/apis/js-apis-hitracemeter.md
浏览文件 @
9bfd5485
...
...
@@ -6,7 +6,7 @@
## Modules to Import
```
```
javascript
import
hiTraceMeter
from
'
@ohos.hiTraceMeter
'
;
```
...
...
@@ -32,7 +32,7 @@ If the trace tasks with the same name are not performed at the same time, the sa
**Example**
```
```
javascript
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
,
5
);
// The expected duration of the trace task is 5 ms.
```
...
...
@@ -57,11 +57,11 @@ To stop a trace task, the values of name and task ID in **finishTrace** must be
**Example**
```
```
javascript
hiTraceMeter
.
finishTrace
(
"
myTestFunc
"
,
1
);
```
```
```
javascript
// Start track tasks with the same name concurrently.
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
// Service flow
...
...
@@ -72,7 +72,7 @@ hiTraceMeter.finishTrace("myTestFunc", 1);
hiTraceMeter
.
finishTrace
(
"
myTestFunc
"
,
2
);
```
```
```
javascript
// Start track tasks with the same name at different times.
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
// Service flow
...
...
@@ -100,7 +100,7 @@ Traces the value changes of a variable.
| count | number | Yes| Value of the variable.|
**Example**
```
```
javascript
let
traceCount
=
3
;
hiTraceMeter
.
traceByValue
(
"
myTestCount
"
,
traceCount
);
traceCount
=
4
;
...
...
zh-cn/application-dev/reference/apis/js-apis-hitracechain.md
浏览文件 @
9bfd5485
...
...
@@ -5,7 +5,7 @@
## 导入模块
```
```
javascript
import
hiTraceChain
from
'
@ohos.hiTraceChain
'
;
```
...
...
@@ -90,7 +90,7 @@ begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId
**示例:**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
|
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
```
...
...
@@ -110,7 +110,7 @@ end(id: HiTraceId): void
**示例:**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
);
// 若干业务逻辑完成后,结束跟踪。
hiTraceChain
.
end
(
asyncTraceId
);
...
...
@@ -132,7 +132,7 @@ getId(): HiTraceId
**示例:**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// 若干业务逻辑完成后,获取当前HiTraceId。
let
curTraceId
=
hiTraceChain
.
getId
();
...
...
@@ -154,7 +154,7 @@ setId(id: HiTraceId): void
**示例:**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// 若干业务逻辑完成后,设置当前HiTraceId。
hiTraceChain
.
setId
(
asyncTraceId
);
...
...
@@ -170,7 +170,7 @@ clearId(): void
**示例:**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// 若干业务逻辑完成后,清除当前HiTraceId。
hiTraceChain
.
clearId
();
...
...
@@ -192,7 +192,7 @@ createSpan(): HiTraceId
**示例:**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
// 若干业务逻辑完成后,创建跟踪分支。
let
spanTraceId
=
hiTraceChain
.
createSpan
();
...
...
@@ -217,7 +217,7 @@ tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTr
**示例:**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
|
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
// 若干业务逻辑完成后,触发信息埋点操作。
hiTraceChain
.
tracepoint
(
hiTraceChain
.
HiTraceCommunicationMode
.
THREAD
,
hiTraceChain
.
HiTraceTracepointType
.
SS
,
asyncTraceId
,
"
Just a example
"
);
...
...
@@ -245,7 +245,7 @@ isValid(id: HiTraceId): boolean
**示例:**
```
```
javascript
let
traceId
=
hiTraceChain
.
begin
(
"
business
"
);
let
traceIdIsvalid
=
hiTraceChain
.
isValid
(
traceId
);
```
...
...
@@ -273,7 +273,7 @@ isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean
**示例:**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
// enabledDoNotCreateSpanFlag为true
let
enabledDoNotCreateSpanFlag
=
hiTraceChain
.
isFlagEnabled
(
asyncTraceId
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
...
...
@@ -295,7 +295,7 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void
**示例:**
```
```
javascript
let
asyncTraceId
=
hiTraceChain
.
begin
(
"
business
"
,
hiTraceChain
.
HiTraceFlag
.
INCLUDE_ASYNC
);
hiTraceChain
.
enable
(
asyncTraceId
,
hiTraceChain
.
HiTraceFlag
.
DONOT_CREATE_SPAN
);
// enabledDoNotCreateSpanFlag为true
...
...
zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md
浏览文件 @
9bfd5485
...
...
@@ -6,7 +6,7 @@
## 导入模块
```
```
javascript
import
hiTraceMeter
from
'
@ohos.hiTraceMeter
'
;
```
...
...
@@ -32,7 +32,7 @@ startTrace(name: string, taskId: number): void
**示例:**
```
```
javascript
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
,
5
);
//从startTrace到finishTrace流程的耗时期望为5ms
```
...
...
@@ -57,11 +57,11 @@ finishTrace的name和taskId必须与流程开始的[startTrace](#hitracemetersta
**示例:**
```
```
javascript
hiTraceMeter
.
finishTrace
(
"
myTestFunc
"
,
1
);
```
```
```
javascript
//追踪并行执行的同名任务
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
//业务流程......
...
...
@@ -72,7 +72,7 @@ hiTraceMeter.finishTrace("myTestFunc", 1);
hiTraceMeter
.
finishTrace
(
"
myTestFunc
"
,
2
);
```
```
```
javascript
//追踪串行执行的同名任务
hiTraceMeter
.
startTrace
(
"
myTestFunc
"
,
1
);
//业务流程......
...
...
@@ -100,7 +100,7 @@ traceByValue(name: string, count: number): void
| count | number | 是 | 变量的值 |
**示例:**
```
```
javascript
let
traceCount
=
3
;
hiTraceMeter
.
traceByValue
(
"
myTestCount
"
,
traceCount
);
traceCount
=
4
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录