From 5822bddf4889210e1f39479b610ab2d3ff4a43f6 Mon Sep 17 00:00:00 2001 From: xuyong Date: Sun, 24 Apr 2022 20:12:40 +0800 Subject: [PATCH] Mark coding language type Signed-off-by: xuyong --- .../reference/apis/js-apis-hitracechain.md | 22 +++++++++---------- .../reference/apis/js-apis-hitracemeter.md | 12 +++++----- .../reference/apis/js-apis-hitracechain.md | 22 +++++++++---------- .../reference/apis/js-apis-hitracemeter.md | 12 +++++----- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-hitracechain.md b/en/application-dev/reference/apis/js-apis-hitracechain.md index 9cd2fd38fb..d7a277fd40 100644 --- a/en/application-dev/reference/apis/js-apis-hitracechain.md +++ b/en/application-dev/reference/apis/js-apis-hitracechain.md @@ -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. diff --git a/en/application-dev/reference/apis/js-apis-hitracemeter.md b/en/application-dev/reference/apis/js-apis-hitracemeter.md index ad7e023755..512003f5f2 100644 --- a/en/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/en/application-dev/reference/apis/js-apis-hitracemeter.md @@ -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; diff --git a/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md b/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md index b87155a74f..77640a44cb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hitracechain.md @@ -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 diff --git a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md index 0f7bb24e9a..1e139846fb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hitracemeter.md @@ -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; -- GitLab