import "github.com/chromedp/cdproto/tracing"
Package tracing provides the Chrome DevTools Protocol commands, types, and events for the Tracing domain.
Generated by the cdproto-gen command.
easyjson.go events.go tracing.go types.go
const ( CommandEnd = "Tracing.end" CommandGetCategories = "Tracing.getCategories" CommandRecordClockSyncMarker = "Tracing.recordClockSyncMarker" CommandRequestMemoryDump = "Tracing.requestMemoryDump" CommandStart = "Tracing.start" )
Command names.
type EndParams struct{}
EndParams stop trace events collection.
End stop trace events collection.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-end
Do executes Tracing.end against the provided context.
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
type EventBufferUsage 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. }
EventBufferUsage [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-bufferUsage
func (v EventBufferUsage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventBufferUsage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *EventBufferUsage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventBufferUsage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EventDataCollected struct { Value []easyjson.RawMessage `json:"value"` }
EventDataCollected 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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-dataCollected
func (v EventDataCollected) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventDataCollected) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *EventDataCollected) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventDataCollected) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EventTracingComplete 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. }
EventTracingComplete signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-tracingComplete
func (v EventTracingComplete) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventTracingComplete) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *EventTracingComplete) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventTracingComplete) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetCategoriesParams struct{}
GetCategoriesParams gets supported tracing categories.
func GetCategories() *GetCategoriesParams
GetCategories gets supported tracing categories.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-getCategories
Do executes Tracing.getCategories against the provided context.
returns:
categories - A list of supported tracing categories.
func (v GetCategoriesParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetCategoriesParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetCategoriesParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetCategoriesParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetCategoriesReturns struct { Categories []string `json:"categories,omitempty"` // A list of supported tracing categories. }
GetCategoriesReturns return values.
func (v GetCategoriesReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetCategoriesReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetCategoriesReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetCategoriesReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MemoryDumpConfig struct{}
MemoryDumpConfig configuration for memory dump. Used only when "memory-infra" category is enabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-MemoryDumpConfig
func (v MemoryDumpConfig) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v MemoryDumpConfig) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *MemoryDumpConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *MemoryDumpConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
MemoryDumpLevelOfDetail details exposed when memory request explicitly declared. Keep consistent with memory_dump_request_args.h and memory_instrumentation.mojom.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-MemoryDumpLevelOfDetail
const ( MemoryDumpLevelOfDetailBackground MemoryDumpLevelOfDetail = "background" MemoryDumpLevelOfDetailLight MemoryDumpLevelOfDetail = "light" MemoryDumpLevelOfDetailDetailed MemoryDumpLevelOfDetail = "detailed" )
MemoryDumpLevelOfDetail values.
func (t MemoryDumpLevelOfDetail) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t MemoryDumpLevelOfDetail) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t MemoryDumpLevelOfDetail) String() string
String returns the MemoryDumpLevelOfDetail as string value.
func (t *MemoryDumpLevelOfDetail) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *MemoryDumpLevelOfDetail) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type RecordClockSyncMarkerParams struct { SyncID string `json:"syncId"` // The ID of this clock sync marker }
RecordClockSyncMarkerParams record a clock sync marker in the trace.
func RecordClockSyncMarker(syncID string) *RecordClockSyncMarkerParams
RecordClockSyncMarker record a clock sync marker in the trace.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-recordClockSyncMarker
parameters:
syncID - The ID of this clock sync marker
func (p *RecordClockSyncMarkerParams) Do(ctx context.Context) (err error)
Do executes Tracing.recordClockSyncMarker against the provided context.
func (v RecordClockSyncMarkerParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v RecordClockSyncMarkerParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *RecordClockSyncMarkerParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RecordClockSyncMarkerParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
RecordMode controls how the trace buffer stores data.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-TraceConfig
const ( RecordModeRecordUntilFull RecordMode = "recordUntilFull" RecordModeRecordContinuously RecordMode = "recordContinuously" RecordModeRecordAsMuchAsPossible RecordMode = "recordAsMuchAsPossible" RecordModeEchoToConsole RecordMode = "echoToConsole" )
RecordMode values.
func (t RecordMode) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t RecordMode) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t RecordMode) String() string
String returns the RecordMode as string value.
func (t *RecordMode) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *RecordMode) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type RequestMemoryDumpParams 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". }
RequestMemoryDumpParams request a global memory dump.
func RequestMemoryDump() *RequestMemoryDumpParams
RequestMemoryDump request a global memory dump.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-requestMemoryDump
parameters:
func (p *RequestMemoryDumpParams) Do(ctx context.Context) (dumpGUID string, success bool, err error)
Do executes Tracing.requestMemoryDump against the provided context.
returns:
dumpGUID - GUID of the resulting global memory dump. success - True iff the global memory dump succeeded.
func (v RequestMemoryDumpParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v RequestMemoryDumpParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *RequestMemoryDumpParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RequestMemoryDumpParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p RequestMemoryDumpParams) WithDeterministic(deterministic bool) *RequestMemoryDumpParams
WithDeterministic enables more deterministic results by forcing garbage collection.
func (p RequestMemoryDumpParams) WithLevelOfDetail(levelOfDetail MemoryDumpLevelOfDetail) *RequestMemoryDumpParams
WithLevelOfDetail specifies level of details in memory dump. Defaults to "detailed".
type RequestMemoryDumpReturns struct { DumpGUID string `json:"dumpGuid,omitempty"` // GUID of the resulting global memory dump. Success bool `json:"success,omitempty"` // True iff the global memory dump succeeded. }
RequestMemoryDumpReturns return values.
func (v RequestMemoryDumpReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v RequestMemoryDumpReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *RequestMemoryDumpReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RequestMemoryDumpReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StartParams struct { BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"` // If set, the agent will issue bufferUsage events at this interval, specified in milliseconds TransferMode TransferMode `json:"transferMode,omitempty"` // Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents). 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"` PerfettoConfig string `json:"perfettoConfig,omitempty"` // Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters categories, options, traceConfig are ignored. }
StartParams start trace events collection.
func Start() *StartParams
Start start trace events collection.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-start
parameters:
func (p *StartParams) Do(ctx context.Context) (err error)
Do executes Tracing.start against the provided context.
func (v StartParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v StartParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *StartParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *StartParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p StartParams) WithBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartParams
WithBufferUsageReportingInterval if set, the agent will issue bufferUsage events at this interval, specified in milliseconds.
func (p StartParams) WithPerfettoConfig(perfettoConfig string) *StartParams
WithPerfettoConfig base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters categories, options, traceConfig are ignored.
func (p StartParams) WithStreamCompression(streamCompression StreamCompression) *StartParams
WithStreamCompression compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none).
func (p StartParams) WithStreamFormat(streamFormat StreamFormat) *StartParams
WithStreamFormat trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams
WithTraceConfig [no description].
func (p StartParams) WithTransferMode(transferMode TransferMode) *StartParams
WithTransferMode whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).
StreamCompression compression type to use for traces returned via streams.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-StreamCompression
const ( StreamCompressionNone StreamCompression = "none" StreamCompressionGzip StreamCompression = "gzip" )
StreamCompression values.
func (t StreamCompression) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t StreamCompression) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t StreamCompression) String() string
String returns the StreamCompression as string value.
func (t *StreamCompression) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *StreamCompression) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-StreamFormat
const ( StreamFormatJSON StreamFormat = "json" StreamFormatProto StreamFormat = "proto" )
StreamFormat values.
func (t StreamFormat) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t StreamFormat) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t StreamFormat) String() string
String returns the StreamFormat as string value.
func (t *StreamFormat) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *StreamFormat) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type TraceConfig struct { RecordMode RecordMode `json:"recordMode,omitempty"` // Controls how the trace buffer stores data. 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 [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-TraceConfig
func (v TraceConfig) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v TraceConfig) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *TraceConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *TraceConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
TransferMode whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).
See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-start
const ( TransferModeReportEvents TransferMode = "ReportEvents" TransferModeReturnAsStream TransferMode = "ReturnAsStream" )
TransferMode values.
func (t TransferMode) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TransferMode) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t TransferMode) String() string
String returns the TransferMode as string value.
func (t *TransferMode) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TransferMode) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
Package tracing imports 8 packages (graph) and is imported by 3 packages. Updated 2021-01-07. Refresh now. Tools for package owners.