Documentation ¶
Overview ¶
Package tracing implements the Tracing domain.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type Backend
- type BufferUsageClient
- type BufferUsageReply
- type CompleteClient
- type CompleteReply
- type DataCollectedClient
- type DataCollectedReply
- type GetCategoriesReply
- type MemoryDumpConfig
- type MemoryDumpLevelOfDetail
- type RecordClockSyncMarkerArgs
- type RequestMemoryDumpArgs
- type RequestMemoryDumpReply
- type StartArgs
- func (a *StartArgs) SetBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartArgs
- func (a *StartArgs) SetCategories(categories string) *StartArgsdeprecated
- func (a *StartArgs) SetOptions(options string) *StartArgsdeprecated
- func (a *StartArgs) SetPerfettoConfig(perfettoConfig []byte) *StartArgs
- func (a *StartArgs) SetStreamCompression(streamCompression StreamCompression) *StartArgs
- func (a *StartArgs) SetStreamFormat(streamFormat StreamFormat) *StartArgs
- func (a *StartArgs) SetTraceConfig(traceConfig TraceConfig) *StartArgs
- func (a *StartArgs) SetTracingBackend(tracingBackend Backend) *StartArgs
- func (a *StartArgs) SetTransferMode(transferMode string) *StartArgs
- type StreamCompression
- type StreamFormat
- type TraceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶ added in v0.31.0
type Backend string
Backend Backend type to use for tracing. `chrome` uses the Chrome-integrated tracing service and is supported on all platforms. `system` is only supported on Chrome OS and uses the Perfetto system tracing service. `auto` chooses `system` when the perfettoConfig provided to Tracing.start specifies at least one non-Chrome data source; otherwise uses `chrome`.
type BufferUsageClient ¶
type BufferUsageClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*BufferUsageReply, error) rpcc.Stream }
BufferUsageClient is a client for BufferUsage events.
type BufferUsageReply ¶
type BufferUsageReply struct { PercentFull *float64 `json:"percentFull,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. EventCount *float64 `json:"eventCount,omitempty"` // An approximate number of events in the trace log. Value *float64 `json:"value,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. }
BufferUsageReply is the reply for BufferUsage events.
type CompleteClient ¶
type CompleteClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*CompleteReply, error) rpcc.Stream }
CompleteClient is a client for TracingComplete events. Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
type CompleteReply ¶
type CompleteReply struct { DataLossOccurred bool `json:"dataLossOccurred"` // Indicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around. Stream *io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data. TraceFormat StreamFormat `json:"traceFormat,omitempty"` // Trace data format of returned stream. StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format of returned stream. }
CompleteReply is the reply for TracingComplete events.
type DataCollectedClient ¶
type DataCollectedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*DataCollectedReply, error) rpcc.Stream }
DataCollectedClient is a client for DataCollected events. Contains an bucket of collected trace events. When tracing is stopped collected events will be send as a sequence of dataCollected events followed by tracingComplete event.
type DataCollectedReply ¶
type DataCollectedReply struct {
Value []json.RawMessage `json:"value"` // No description.
}
DataCollectedReply is the reply for DataCollected events.
type GetCategoriesReply ¶
type GetCategoriesReply struct {
Categories []string `json:"categories"` // A list of supported tracing categories.
}
GetCategoriesReply represents the return values for GetCategories in the Tracing domain.
type MemoryDumpConfig ¶
type MemoryDumpConfig []byte
MemoryDumpConfig Configuration for memory dump. Used only when "memory-infra" category is enabled.
func (MemoryDumpConfig) MarshalJSON ¶
func (m MemoryDumpConfig) MarshalJSON() ([]byte, error)
MarshalJSON copies behavior of json.RawMessage.
func (*MemoryDumpConfig) UnmarshalJSON ¶
func (m *MemoryDumpConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON copies behavior of json.RawMessage.
type MemoryDumpLevelOfDetail ¶ added in v0.31.0
type MemoryDumpLevelOfDetail string
MemoryDumpLevelOfDetail Details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom
const ( MemoryDumpLevelOfDetailNotSet MemoryDumpLevelOfDetail = "" MemoryDumpLevelOfDetailBackground MemoryDumpLevelOfDetail = "background" MemoryDumpLevelOfDetailLight MemoryDumpLevelOfDetail = "light" MemoryDumpLevelOfDetailDetailed MemoryDumpLevelOfDetail = "detailed" )
MemoryDumpLevelOfDetail as enums.
func (MemoryDumpLevelOfDetail) String ¶ added in v0.31.0
func (e MemoryDumpLevelOfDetail) String() string
func (MemoryDumpLevelOfDetail) Valid ¶ added in v0.31.0
func (e MemoryDumpLevelOfDetail) Valid() bool
type RecordClockSyncMarkerArgs ¶
type RecordClockSyncMarkerArgs struct {
SyncID string `json:"syncId"` // The ID of this clock sync marker
}
RecordClockSyncMarkerArgs represents the arguments for RecordClockSyncMarker in the Tracing domain.
func NewRecordClockSyncMarkerArgs ¶
func NewRecordClockSyncMarkerArgs(syncID string) *RecordClockSyncMarkerArgs
NewRecordClockSyncMarkerArgs initializes RecordClockSyncMarkerArgs with the required arguments.
type RequestMemoryDumpArgs ¶ added in v0.25.0
type RequestMemoryDumpArgs struct { Deterministic *bool `json:"deterministic,omitempty"` // Enables more deterministic results by forcing garbage collection LevelOfDetail MemoryDumpLevelOfDetail `json:"levelOfDetail,omitempty"` // Specifies level of details in memory dump. Defaults to "detailed". }
RequestMemoryDumpArgs represents the arguments for RequestMemoryDump in the Tracing domain.
func NewRequestMemoryDumpArgs ¶ added in v0.25.0
func NewRequestMemoryDumpArgs() *RequestMemoryDumpArgs
NewRequestMemoryDumpArgs initializes RequestMemoryDumpArgs with the required arguments.
func (*RequestMemoryDumpArgs) SetDeterministic ¶ added in v0.25.0
func (a *RequestMemoryDumpArgs) SetDeterministic(deterministic bool) *RequestMemoryDumpArgs
SetDeterministic sets the Deterministic optional argument. Enables more deterministic results by forcing garbage collection
func (*RequestMemoryDumpArgs) SetLevelOfDetail ¶ added in v0.31.0
func (a *RequestMemoryDumpArgs) SetLevelOfDetail(levelOfDetail MemoryDumpLevelOfDetail) *RequestMemoryDumpArgs
SetLevelOfDetail sets the LevelOfDetail optional argument. Specifies level of details in memory dump. Defaults to "detailed".
type RequestMemoryDumpReply ¶
type RequestMemoryDumpReply struct { DumpGUID string `json:"dumpGuid"` // GUID of the resulting global memory dump. Success bool `json:"success"` // True iff the global memory dump succeeded. }
RequestMemoryDumpReply represents the return values for RequestMemoryDump in the Tracing domain.
type StartArgs ¶
type StartArgs struct { // Categories is deprecated. // // Deprecated: Category/tag filter Categories *string `json:"categories,omitempty"` // Options is deprecated. // // Deprecated: Tracing options Options *string `json:"options,omitempty"` BufferUsageReportingInterval *float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds // TransferMode Whether to report trace events as series of // dataCollected events or to save trace to a stream (defaults to // `ReportEvents`). // // Values: "ReportEvents", "ReturnAsStream". TransferMode *string `json:"transferMode,omitempty"` StreamFormat StreamFormat `json:"streamFormat,omitempty"` // Trace data format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `json`). StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `none`) TraceConfig *TraceConfig `json:"traceConfig,omitempty"` // No description. PerfettoConfig []byte `json:"perfettoConfig,omitempty"` // Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters `categories`, `options`, `traceConfig` are ignored. (Encoded as a base64 string when passed over JSON) TracingBackend Backend `json:"tracingBackend,omitempty"` // Backend type (defaults to `auto`) }
StartArgs represents the arguments for Start in the Tracing domain.
func NewStartArgs ¶
func NewStartArgs() *StartArgs
NewStartArgs initializes StartArgs with the required arguments.
func (*StartArgs) SetBufferUsageReportingInterval ¶
func (a *StartArgs) SetBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartArgs
SetBufferUsageReportingInterval sets the BufferUsageReportingInterval optional argument. If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
func (*StartArgs) SetCategories
deprecated
func (*StartArgs) SetOptions
deprecated
func (*StartArgs) SetPerfettoConfig ¶ added in v0.31.0
SetPerfettoConfig sets the PerfettoConfig optional argument. Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters `categories`, `options`, `traceConfig` are ignored. (Encoded as a base64 string when passed over JSON)
func (*StartArgs) SetStreamCompression ¶ added in v0.15.3
func (a *StartArgs) SetStreamCompression(streamCompression StreamCompression) *StartArgs
SetStreamCompression sets the StreamCompression optional argument. Compression format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `none`)
func (*StartArgs) SetStreamFormat ¶ added in v0.23.1
func (a *StartArgs) SetStreamFormat(streamFormat StreamFormat) *StartArgs
SetStreamFormat sets the StreamFormat optional argument. Trace data format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `json`).
func (*StartArgs) SetTraceConfig ¶
func (a *StartArgs) SetTraceConfig(traceConfig TraceConfig) *StartArgs
SetTraceConfig sets the TraceConfig optional argument.
func (*StartArgs) SetTracingBackend ¶ added in v0.31.0
SetTracingBackend sets the TracingBackend optional argument. Backend type (defaults to `auto`)
func (*StartArgs) SetTransferMode ¶
SetTransferMode sets the TransferMode optional argument. Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to `ReportEvents`).
Values: "ReportEvents", "ReturnAsStream".
type StreamCompression ¶ added in v0.15.3
type StreamCompression string
StreamCompression Compression type to use for traces returned via streams.
const ( StreamCompressionNotSet StreamCompression = "" StreamCompressionNone StreamCompression = "none" StreamCompressionGzip StreamCompression = "gzip" )
StreamCompression as enums.
func (StreamCompression) String ¶ added in v0.15.3
func (e StreamCompression) String() string
func (StreamCompression) Valid ¶ added in v0.15.3
func (e StreamCompression) Valid() bool
type StreamFormat ¶ added in v0.23.1
type StreamFormat string
StreamFormat Data format of a trace. Can be either the legacy JSON format or the protocol buffer format. Note that the JSON format will be deprecated soon.
const ( StreamFormatNotSet StreamFormat = "" StreamFormatJSON StreamFormat = "json" StreamFormatProto StreamFormat = "proto" )
StreamFormat as enums.
func (StreamFormat) String ¶ added in v0.23.1
func (e StreamFormat) String() string
func (StreamFormat) Valid ¶ added in v0.23.1
func (e StreamFormat) Valid() bool
type TraceConfig ¶
type TraceConfig struct { // RecordMode Controls how the trace buffer stores data. // // Values: "recordUntilFull", "recordContinuously", "recordAsMuchAsPossible", "echoToConsole". RecordMode *string `json:"recordMode,omitempty"` EnableSampling *bool `json:"enableSampling,omitempty"` // Turns on JavaScript stack sampling. EnableSystrace *bool `json:"enableSystrace,omitempty"` // Turns on system tracing. EnableArgumentFilter *bool `json:"enableArgumentFilter,omitempty"` // Turns on argument filter. IncludedCategories []string `json:"includedCategories,omitempty"` // Included category filters. ExcludedCategories []string `json:"excludedCategories,omitempty"` // Excluded category filters. SyntheticDelays []string `json:"syntheticDelays,omitempty"` // Configuration to synthesize the delays in tracing. MemoryDumpConfig MemoryDumpConfig `json:"memoryDumpConfig,omitempty"` // Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. }
TraceConfig