Tracing
✅️️ Methods
🔨Tracing.end
停止跟踪事件收集。
EN
Stop trace events collection.
🔨Tracing.start
开始跟踪事件收集。
EN
Start trace events collection.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| categories | 🧪 | string | 类别/标签过滤器 | ENCategory/tag filter | |
| options | 🧪 | string | 追踪选项 | ENTracing options | |
| bufferUsageReportingInterval | 🧪 | number | 如果设置了此项,代理将按照此间隔(以毫秒为单位)发出bufferUsage事件 | ENIf set, the agent will issue bufferUsage events at this interval, specified in milliseconds | |
| transferMode | string | 是否将跟踪事件报告为一系列数据收集事件,还是将跟踪保存到流中(默认为ReportEvents)。允许的值: ReportEvents、ReturnAsStream | ENWhether to report trace events as series of dataCollected events or to save trace to a stream (defaults toReportEvents).Allowed Values: ReportEvents, ReturnAsStream | ||
| streamFormat | StreamFormat | 要使用的跟踪数据格式。这仅在使用 ReturnAsStream 传输模式时适用(默认为 json)。 | ENTrace data format to use. This only applies when usingReturnAsStream transfer mode (defaults to json). | ||
| streamCompression | 🧪 | StreamCompression | 使用的压缩格式。这仅在使用ReturnAsStream传输模式时适用(默认为none)。 | ENCompression format to use. This only applies when usingReturnAsStream transfer mode (defaults to none) | |
| traceConfig | TraceConfig | ||||
| perfettoConfig | 🧪 | string | Base64编码的序列化perfetto.protos.TraceConfig protobuf消息。指定此参数时,将忽略categories、options、traceConfig等参数。(通过JSON传递时需编码为base64字符串) | ENBase64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameterscategories, options, traceConfig are ignored. (Encoded as a base64 string when passed over JSON) | |
| tracingBackend | 🧪 | TracingBackend | 后端类型(默认为 auto) | ENBackend type (defaults toauto) |
🔨Tracing.getCategories🧪
获取支持的跟踪类别。
EN
Gets supported tracing categories.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| categories | array[string] | 支持的跟踪类别列表。 | ENA list of supported tracing categories. |
🔨Tracing.getTrackEventDescriptor🧪
返回所有可用跟踪类别的描述符。
EN
Return a descriptor for all available tracing categories.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| descriptor | string | Base64编码的序列化perfetto.protos.TrackEventDescriptor protobuf消息。(通过JSON传递时以base64字符串形式编码) | ENBase64-encoded serialized perfetto.protos.TrackEventDescriptor protobuf message. (Encoded as a base64 string when passed over JSON) |
🔨Tracing.recordClockSyncMarker🧪
在跟踪记录中记录一个时钟同步标记。
EN
Record a clock sync marker in the trace.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| syncId | ✔️ | string | 此时钟同步标记的ID | ENThe ID of this clock sync marker |
🔨Tracing.requestMemoryDump🧪
请求一个全局内存转储。
EN
Request a global memory dump.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| deterministic | boolean | 通过强制垃圾回收实现更确定的结果 | ENEnables more deterministic results by forcing garbage collection | ||
| levelOfDetail | MemoryDumpLevelOfDetail | 指定内存转储的详细程度。默认为 "detailed"。 | ENSpecifies level of details in memory dump. Defaults to "detailed". |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| dumpGuid | string | 生成的全局内存转储的GUID。 | ENGUID of the resulting global memory dump. |
| success | boolean | 全局内存转储成功时为真。 | ENTrue iff the global memory dump succeeded. |
✅️️ Events
👋Tracing.tracingComplete
发出信号表示跟踪已停止,且没有待刷新的跟踪缓冲区,所有数据已通过dataCollected事件完成传输。
EN
Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| dataLossOccurred | ✔️ | boolean | 表示是否已知某些跟踪数据已丢失,例如由于跟踪环形缓冲区环绕所致。 | ENIndicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around. | |
| stream | IO.StreamHandle | 包含结果跟踪数据的流的句柄。 | ENA handle of the stream that holds resulting trace data. | ||
| traceFormat | StreamFormat | 返回流的跟踪数据格式。 | ENTrace data format of returned stream. | ||
| streamCompression | StreamCompression | 返回流的 压缩格式。 | ENCompression format of returned stream. |
👋Tracing.bufferUsage🧪
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| percentFull | number | 一个在范围 [0..1] 内的数字,表示事件缓冲区已使用大小与其总大小的比例。 | ENA number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. | ||
| eventCount | number | 跟踪日志中的事件近似数量。 | ENAn approximate number of events in the trace log. | ||
| value | number | 一个范围在[0..1]之间的数值,表示事件缓冲区已使用大小占总容量的比例。 | ENA number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. |
👋Tracing.dataCollected🧪
包含一系列收集到的跟踪事件。当跟踪停止时,收集到的事件将以一系列 dataCollected 事件的形式发送,随后是 tracingComplete 事件。
EN
Contains a bucket of collected trace events. When tracing is stopped collected events will be sent as a sequence of dataCollected events followed by tracingComplete event.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| value | ✔️ | array[object] |
✅️️ Types
📌Tracing.TraceConfig
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| recordMode | 🧪 | string | 控制跟踪缓冲区如何存储数据。默认值为 recordUntilFull。允许的取值: recordUntilFull、recordContinuously、recordAsMuchAsPossible、echoToConsole | ENControls how the trace buffer stores data. The default isrecordUntilFull.Allowed Values: recordUntilFull, recordContinuously, recordAsMuchAsPossible, echoToConsole | |
| traceBufferSizeInKb | 🧪 | number | 跟踪缓冲区的大小,以千字节为单位。如果未指定或传入零,将使用默认值200 MB。 | ENSize of the trace buffer in kilobytes. If not specified or zero is passed, a default value of 200 MB would be used. | |
| enableSampling | 🧪 | boolean | 启用JavaScript堆栈采样。 | ENTurns on JavaScript stack sampling. | |
| enableSystrace | 🧪 | boolean | 开启系统追踪功能。 | ENTurns on system tracing. | |
| enableArgumentFilter | 🧪 | boolean | 启用参数筛选器。 | ENTurns on argument filter. | |
| includedCategories | array[string] | 包含的类别筛选器。 | ENIncluded category filters. | ||
| excludedCategories | array[string] | 排除的类别筛选器。 | ENExcluded category filters. | ||
| syntheticDelays | 🧪 | array[string] | 配置以合成追踪中的延迟。 | ENConfiguration to synthesize the delays in tracing. | |
| memoryDumpConfig | 🧪 | MemoryDumpConfig | 内存转储触发器配置。仅在启用“memory-infra”类别时使用。 | ENConfiguration for memory dump triggers. Used only when "memory-infra" category is enabled. |
📌Tracing.MemoryDumpConfig🧪
内存转储配置。仅在启用 "memory-infra" 类别时使用。
EN
Configuration for memory dump. Used only when "memory-infra" category is enabled.
返回类型:object