提交 f2f461a7 编写于 作者: X xuyong

Modify the wrong api call.

Signed-off-by: Nxuyong <xuyong59@huawei.com>
上级 babe8360
......@@ -155,6 +155,7 @@ Sets a trace ID. This API works in synchronous manner.
**Example**
```js
let asyncTraceId;
let traceId = hiTraceChain.begin("business");
// Set the current trace ID after the service logic is executed for several times.
hiTraceChain.setId(asyncTraceId);
......@@ -297,7 +298,7 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i
```js
let asyncTraceId = hiTraceChain.begin("business", hiTraceChain.HiTraceFlag.INCLUDE_ASYNC);
hiTraceChain.enable(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
hiTraceChain.enableFlag(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
// The value of enabledDoNotCreateSpanFlag is true.
let enabledDoNotCreateSpanFlag = hiTraceChain.isFlagEnabled(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
```
\ No newline at end of file
```
......@@ -34,7 +34,6 @@ If the trace tasks with the same name are not performed at the same time, the sa
```js
hiTraceMeter.startTrace("myTestFunc", 1);
hiTraceMeter.startTrace("myTestFunc", 1, 5); // The expected duration of the trace task is 5 ms.
```
......
......@@ -155,6 +155,7 @@ setId(id: HiTraceId): void
**示例:**
```js
let asyncTraceId;
let traceId = hiTraceChain.begin("business");
// 若干业务逻辑完成后,设置当前HiTraceId。
hiTraceChain.setId(asyncTraceId);
......@@ -297,7 +298,7 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void
```js
let asyncTraceId = hiTraceChain.begin("business", hiTraceChain.HiTraceFlag.INCLUDE_ASYNC);
hiTraceChain.enable(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
hiTraceChain.enableFlag(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
// enabledDoNotCreateSpanFlag为true
let enabledDoNotCreateSpanFlag = hiTraceChain.isFlagEnabled(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
```
......@@ -34,7 +34,6 @@ startTrace(name: string, taskId: number): void
```js
hiTraceMeter.startTrace("myTestFunc", 1);
hiTraceMeter.startTrace("myTestFunc", 1, 5); //从startTrace到finishTrace流程的耗时期望为5ms
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册