Documentation ¶
Overview ¶
Package profiler implements the Profiler domain.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type ConsoleProfileFinishedClient
- type ConsoleProfileFinishedReply
- type ConsoleProfileStartedClient
- type ConsoleProfileStartedReply
- type CoverageRange
- type FunctionCoverage
- type GetBestEffortCoverageReply
- type PositionTickInfo
- type Profile
- type ProfileNode
- type ScriptCoverage
- type SetSamplingIntervalArgs
- type StartPreciseCoverageArgs
- type StopReply
- type TakePreciseCoverageReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleProfileFinishedClient ¶
type ConsoleProfileFinishedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ConsoleProfileFinishedReply, error) rpcc.Stream }
ConsoleProfileFinishedClient is a client for ConsoleProfileFinished events.
type ConsoleProfileFinishedReply ¶
type ConsoleProfileFinishedReply struct { ID string `json:"id"` // No description. Location debugger.Location `json:"location"` // Location of console.profileEnd(). Profile Profile `json:"profile"` // No description. Title *string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). }
ConsoleProfileFinishedReply is the reply for ConsoleProfileFinished events.
type ConsoleProfileStartedClient ¶
type ConsoleProfileStartedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*ConsoleProfileStartedReply, error) rpcc.Stream }
ConsoleProfileStartedClient is a client for ConsoleProfileStarted events. Sent when new profile recording is started using console.profile() call.
type ConsoleProfileStartedReply ¶
type ConsoleProfileStartedReply struct { ID string `json:"id"` // No description. Location debugger.Location `json:"location"` // Location of console.profile(). Title *string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). }
ConsoleProfileStartedReply is the reply for ConsoleProfileStarted events.
type CoverageRange ¶
type CoverageRange struct { StartOffset int `json:"startOffset"` // JavaScript script source offset for the range start. EndOffset int `json:"endOffset"` // JavaScript script source offset for the range end. Count int `json:"count"` // Collected execution count of the source range. }
CoverageRange Coverage data for a source range.
Note: This type is experimental.
type FunctionCoverage ¶
type FunctionCoverage struct { FunctionName string `json:"functionName"` // JavaScript function name. Ranges []CoverageRange `json:"ranges"` // Source ranges inside the function with coverage data. IsBlockCoverage bool `json:"isBlockCoverage"` // Whether coverage data for this function has block granularity. }
FunctionCoverage Coverage data for a JavaScript function.
Note: This type is experimental.
type GetBestEffortCoverageReply ¶
type GetBestEffortCoverageReply struct {
Result []ScriptCoverage `json:"result"` // Coverage data for the current isolate.
}
GetBestEffortCoverageReply represents the return values for GetBestEffortCoverage in the Profiler domain.
type PositionTickInfo ¶
type PositionTickInfo struct { Line int `json:"line"` // Source line number (1-based). Ticks int `json:"ticks"` // Number of samples attributed to the source line. }
PositionTickInfo Specifies a number of samples attributed to a certain source position.
Note: This type is experimental.
type Profile ¶
type Profile struct { Nodes []ProfileNode `json:"nodes"` // The list of profile nodes. First item is the root node. StartTime float64 `json:"startTime"` // Profiling start timestamp in microseconds. EndTime float64 `json:"endTime"` // Profiling end timestamp in microseconds. Samples []int `json:"samples,omitempty"` // Ids of samples top nodes. TimeDeltas []int `json:"timeDeltas,omitempty"` // Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. }
Profile Profile.
type ProfileNode ¶
type ProfileNode struct { ID int `json:"id"` // Unique id of the node. CallFrame runtime.CallFrame `json:"callFrame"` // Function location. // HitCount Number of samples where this node was on top of the call stack. // // Note: This property is experimental. HitCount *int `json:"hitCount,omitempty"` Children []int `json:"children,omitempty"` // Child node ids. DeoptReason *string `json:"deoptReason,omitempty"` // The reason of being not optimized. The function may be deoptimized or marked as don't optimize. // PositionTicks An array of source position ticks. // // Note: This property is experimental. PositionTicks []PositionTickInfo `json:"positionTicks,omitempty"` }
ProfileNode Profile node. Holds callsite information, execution statistics and child nodes.
type ScriptCoverage ¶
type ScriptCoverage struct { ScriptID runtime.ScriptID `json:"scriptId"` // JavaScript script id. URL string `json:"url"` // JavaScript script name or url. Functions []FunctionCoverage `json:"functions"` // Functions contained in the script that has coverage data. }
ScriptCoverage Coverage data for a JavaScript script.
Note: This type is experimental.
type SetSamplingIntervalArgs ¶
type SetSamplingIntervalArgs struct {
Interval int `json:"interval"` // New sampling interval in microseconds.
}
SetSamplingIntervalArgs represents the arguments for SetSamplingInterval in the Profiler domain.
func NewSetSamplingIntervalArgs ¶
func NewSetSamplingIntervalArgs(interval int) *SetSamplingIntervalArgs
NewSetSamplingIntervalArgs initializes SetSamplingIntervalArgs with the required arguments.
type StartPreciseCoverageArgs ¶
type StartPreciseCoverageArgs struct { CallCount *bool `json:"callCount,omitempty"` // Collect accurate call counts beyond simple 'covered' or 'not covered'. Detailed *bool `json:"detailed,omitempty"` // Collect block-based coverage. }
StartPreciseCoverageArgs represents the arguments for StartPreciseCoverage in the Profiler domain.
func NewStartPreciseCoverageArgs ¶
func NewStartPreciseCoverageArgs() *StartPreciseCoverageArgs
NewStartPreciseCoverageArgs initializes StartPreciseCoverageArgs with the required arguments.
func (*StartPreciseCoverageArgs) SetCallCount ¶
func (a *StartPreciseCoverageArgs) SetCallCount(callCount bool) *StartPreciseCoverageArgs
SetCallCount sets the CallCount optional argument. Collect accurate call counts beyond simple 'covered' or 'not covered'.
func (*StartPreciseCoverageArgs) SetDetailed ¶ added in v0.11.4
func (a *StartPreciseCoverageArgs) SetDetailed(detailed bool) *StartPreciseCoverageArgs
SetDetailed sets the Detailed optional argument. Collect block-based coverage.
type StopReply ¶
type StopReply struct {
Profile Profile `json:"profile"` // Recorded profile.
}
StopReply represents the return values for Stop in the Profiler domain.
type TakePreciseCoverageReply ¶
type TakePreciseCoverageReply struct {
Result []ScriptCoverage `json:"result"` // Coverage data for the current isolate.
}
TakePreciseCoverageReply represents the return values for TakePreciseCoverage in the Profiler domain.