Documentation
¶
Overview ¶
Package heapprofiler implements the HeapProfiler domain.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type AddHeapSnapshotChunkClient
- type AddHeapSnapshotChunkReply
- type AddInspectedHeapObjectArgs
- type GetHeapObjectIDArgs
- type GetHeapObjectIDReply
- type GetObjectByHeapObjectIDArgs
- type GetObjectByHeapObjectIDReply
- type GetSamplingProfileReply
- type HeapSnapshotObjectID
- type HeapStatsUpdateClient
- type HeapStatsUpdateReply
- type LastSeenObjectIDClient
- type LastSeenObjectIDReply
- type ReportHeapSnapshotProgressClient
- type ReportHeapSnapshotProgressReply
- type ResetProfilesClient
- type ResetProfilesReply
- type SamplingHeapProfile
- type SamplingHeapProfileNode
- type SamplingHeapProfileSample
- type StartSamplingArgs
- func (a *StartSamplingArgs) SetIncludeObjectsCollectedByMajorGC(includeObjectsCollectedByMajorGC bool) *StartSamplingArgs
- func (a *StartSamplingArgs) SetIncludeObjectsCollectedByMinorGC(includeObjectsCollectedByMinorGC bool) *StartSamplingArgs
- func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval float64) *StartSamplingArgs
- type StartTrackingHeapObjectsArgs
- type StopSamplingReply
- type StopTrackingHeapObjectsArgs
- func (a *StopTrackingHeapObjectsArgs) SetCaptureNumericValue(captureNumericValue bool) *StopTrackingHeapObjectsArgs
- func (a *StopTrackingHeapObjectsArgs) SetExposeInternals(exposeInternals bool) *StopTrackingHeapObjectsArgs
- func (a *StopTrackingHeapObjectsArgs) SetReportProgress(reportProgress bool) *StopTrackingHeapObjectsArgs
- func (a *StopTrackingHeapObjectsArgs) SetTreatGlobalObjectsAsRoots(treatGlobalObjectsAsRoots bool) *StopTrackingHeapObjectsArgsdeprecated
- type TakeHeapSnapshotArgs
- func (a *TakeHeapSnapshotArgs) SetCaptureNumericValue(captureNumericValue bool) *TakeHeapSnapshotArgs
- func (a *TakeHeapSnapshotArgs) SetExposeInternals(exposeInternals bool) *TakeHeapSnapshotArgs
- func (a *TakeHeapSnapshotArgs) SetReportProgress(reportProgress bool) *TakeHeapSnapshotArgs
- func (a *TakeHeapSnapshotArgs) SetTreatGlobalObjectsAsRoots(treatGlobalObjectsAsRoots bool) *TakeHeapSnapshotArgsdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddHeapSnapshotChunkClient ¶
type AddHeapSnapshotChunkClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*AddHeapSnapshotChunkReply, error)
rpcc.Stream
}
AddHeapSnapshotChunkClient is a client for AddHeapSnapshotChunk events.
type AddHeapSnapshotChunkReply ¶
type AddHeapSnapshotChunkReply struct {
Chunk string `json:"chunk"` // No description.
}
AddHeapSnapshotChunkReply is the reply for AddHeapSnapshotChunk events.
type AddInspectedHeapObjectArgs ¶
type AddInspectedHeapObjectArgs struct {
HeapObjectID HeapSnapshotObjectID `json:"heapObjectId"` // Heap snapshot object id to be accessible by means of $x command line API.
}
AddInspectedHeapObjectArgs represents the arguments for AddInspectedHeapObject in the HeapProfiler domain.
func NewAddInspectedHeapObjectArgs ¶
func NewAddInspectedHeapObjectArgs(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectArgs
NewAddInspectedHeapObjectArgs initializes AddInspectedHeapObjectArgs with the required arguments.
type GetHeapObjectIDArgs ¶
type GetHeapObjectIDArgs struct {
ObjectID runtime.RemoteObjectID `json:"objectId"` // Identifier of the object to get heap object id for.
}
GetHeapObjectIDArgs represents the arguments for GetHeapObjectID in the HeapProfiler domain.
func NewGetHeapObjectIDArgs ¶
func NewGetHeapObjectIDArgs(objectID runtime.RemoteObjectID) *GetHeapObjectIDArgs
NewGetHeapObjectIDArgs initializes GetHeapObjectIDArgs with the required arguments.
type GetHeapObjectIDReply ¶
type GetHeapObjectIDReply struct {
HeapSnapshotObjectID HeapSnapshotObjectID `json:"heapSnapshotObjectId"` // Id of the heap snapshot object corresponding to the passed remote object id.
}
GetHeapObjectIDReply represents the return values for GetHeapObjectID in the HeapProfiler domain.
type GetObjectByHeapObjectIDArgs ¶
type GetObjectByHeapObjectIDArgs struct {
ObjectID HeapSnapshotObjectID `json:"objectId"` // No description.
ObjectGroup *string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
}
GetObjectByHeapObjectIDArgs represents the arguments for GetObjectByHeapObjectID in the HeapProfiler domain.
func NewGetObjectByHeapObjectIDArgs ¶
func NewGetObjectByHeapObjectIDArgs(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDArgs
NewGetObjectByHeapObjectIDArgs initializes GetObjectByHeapObjectIDArgs with the required arguments.
func (*GetObjectByHeapObjectIDArgs) SetObjectGroup ¶
func (a *GetObjectByHeapObjectIDArgs) SetObjectGroup(objectGroup string) *GetObjectByHeapObjectIDArgs
SetObjectGroup sets the ObjectGroup optional argument. Symbolic group name that can be used to release multiple objects.
type GetObjectByHeapObjectIDReply ¶
type GetObjectByHeapObjectIDReply struct {
Result runtime.RemoteObject `json:"result"` // Evaluation result.
}
GetObjectByHeapObjectIDReply represents the return values for GetObjectByHeapObjectID in the HeapProfiler domain.
type GetSamplingProfileReply ¶ added in v0.14.2
type GetSamplingProfileReply struct {
Profile SamplingHeapProfile `json:"profile"` // Return the sampling profile being collected.
}
GetSamplingProfileReply represents the return values for GetSamplingProfile in the HeapProfiler domain.
type HeapSnapshotObjectID ¶
type HeapSnapshotObjectID string
HeapSnapshotObjectID Heap snapshot object id.
type HeapStatsUpdateClient ¶
type HeapStatsUpdateClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*HeapStatsUpdateReply, error)
rpcc.Stream
}
HeapStatsUpdateClient is a client for HeapStatsUpdate events. If heap objects tracking has been started then backend may send update for one or more fragments
type HeapStatsUpdateReply ¶
type HeapStatsUpdateReply struct {
StatsUpdate []int `json:"statsUpdate"` // An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
}
HeapStatsUpdateReply is the reply for HeapStatsUpdate events.
type LastSeenObjectIDClient ¶
type LastSeenObjectIDClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*LastSeenObjectIDReply, error)
rpcc.Stream
}
LastSeenObjectIDClient is a client for LastSeenObjectID events. If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
type LastSeenObjectIDReply ¶
type LastSeenObjectIDReply struct {
LastSeenObjectID int `json:"lastSeenObjectId"` // No description.
Timestamp float64 `json:"timestamp"` // No description.
}
LastSeenObjectIDReply is the reply for LastSeenObjectID events.
type ReportHeapSnapshotProgressClient ¶
type ReportHeapSnapshotProgressClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ReportHeapSnapshotProgressReply, error)
rpcc.Stream
}
ReportHeapSnapshotProgressClient is a client for ReportHeapSnapshotProgress events.
type ReportHeapSnapshotProgressReply ¶
type ReportHeapSnapshotProgressReply struct {
Done int `json:"done"` // No description.
Total int `json:"total"` // No description.
Finished *bool `json:"finished,omitempty"` // No description.
}
ReportHeapSnapshotProgressReply is the reply for ReportHeapSnapshotProgress events.
type ResetProfilesClient ¶
type ResetProfilesClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ResetProfilesReply, error)
rpcc.Stream
}
ResetProfilesClient is a client for ResetProfiles events.
type ResetProfilesReply ¶
type ResetProfilesReply struct {
}
ResetProfilesReply is the reply for ResetProfiles events.
type SamplingHeapProfile ¶
type SamplingHeapProfile struct {
Head SamplingHeapProfileNode `json:"head"` // No description.
Samples []SamplingHeapProfileSample `json:"samples"` // No description.
}
SamplingHeapProfile Sampling profile.
type SamplingHeapProfileNode ¶
type SamplingHeapProfileNode struct {
CallFrame runtime.CallFrame `json:"callFrame"` // Function location.
SelfSize float64 `json:"selfSize"` // Allocations size in bytes for the node excluding children.
ID int `json:"id"` // Node id. Ids are unique across all profiles collected between startSampling and stopSampling.
Children []SamplingHeapProfileNode `json:"children"` // Child nodes.
}
SamplingHeapProfileNode Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
type SamplingHeapProfileSample ¶ added in v0.19.3
type SamplingHeapProfileSample struct {
Size float64 `json:"size"` // Allocation size in bytes attributed to the sample.
NodeID int `json:"nodeId"` // Id of the corresponding profile tree node.
Ordinal float64 `json:"ordinal"` // Time-ordered sample ordinal number. It is unique across all profiles retrieved between startSampling and stopSampling.
}
SamplingHeapProfileSample A single sample from a sampling profile.
type StartSamplingArgs ¶
type StartSamplingArgs struct {
SamplingInterval *float64 `json:"samplingInterval,omitempty"` // Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
IncludeObjectsCollectedByMajorGC *bool `json:"includeObjectsCollectedByMajorGC,omitempty"` // By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.
IncludeObjectsCollectedByMinorGC *bool `json:"includeObjectsCollectedByMinorGC,omitempty"` // By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.
}
StartSamplingArgs represents the arguments for StartSampling in the HeapProfiler domain.
func NewStartSamplingArgs ¶
func NewStartSamplingArgs() *StartSamplingArgs
NewStartSamplingArgs initializes StartSamplingArgs with the required arguments.
func (*StartSamplingArgs) SetIncludeObjectsCollectedByMajorGC ¶ added in v0.35.0
func (a *StartSamplingArgs) SetIncludeObjectsCollectedByMajorGC(includeObjectsCollectedByMajorGC bool) *StartSamplingArgs
SetIncludeObjectsCollectedByMajorGC sets the IncludeObjectsCollectedByMajorGC optional argument. By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.
func (*StartSamplingArgs) SetIncludeObjectsCollectedByMinorGC ¶ added in v0.35.0
func (a *StartSamplingArgs) SetIncludeObjectsCollectedByMinorGC(includeObjectsCollectedByMinorGC bool) *StartSamplingArgs
SetIncludeObjectsCollectedByMinorGC sets the IncludeObjectsCollectedByMinorGC optional argument. By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.
func (*StartSamplingArgs) SetSamplingInterval ¶
func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval float64) *StartSamplingArgs
SetSamplingInterval sets the SamplingInterval optional argument. Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
type StartTrackingHeapObjectsArgs ¶
type StartTrackingHeapObjectsArgs struct {
TrackAllocations *bool `json:"trackAllocations,omitempty"` // No description.
}
StartTrackingHeapObjectsArgs represents the arguments for StartTrackingHeapObjects in the HeapProfiler domain.
func NewStartTrackingHeapObjectsArgs ¶
func NewStartTrackingHeapObjectsArgs() *StartTrackingHeapObjectsArgs
NewStartTrackingHeapObjectsArgs initializes StartTrackingHeapObjectsArgs with the required arguments.
func (*StartTrackingHeapObjectsArgs) SetTrackAllocations ¶
func (a *StartTrackingHeapObjectsArgs) SetTrackAllocations(trackAllocations bool) *StartTrackingHeapObjectsArgs
SetTrackAllocations sets the TrackAllocations optional argument.
type StopSamplingReply ¶
type StopSamplingReply struct {
Profile SamplingHeapProfile `json:"profile"` // Recorded sampling heap profile.
}
StopSamplingReply represents the return values for StopSampling in the HeapProfiler domain.
type StopTrackingHeapObjectsArgs ¶
type StopTrackingHeapObjectsArgs struct {
ReportProgress *bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
// TreatGlobalObjectsAsRoots is deprecated.
//
// Deprecated: Deprecated in favor of `exposeInternals`.
TreatGlobalObjectsAsRoots *bool `json:"treatGlobalObjectsAsRoots,omitempty"`
CaptureNumericValue *bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot
// ExposeInternals If true, exposes internals of the snapshot.
//
// Note: This property is experimental.
ExposeInternals *bool `json:"exposeInternals,omitempty"`
}
StopTrackingHeapObjectsArgs represents the arguments for StopTrackingHeapObjects in the HeapProfiler domain.
func NewStopTrackingHeapObjectsArgs ¶
func NewStopTrackingHeapObjectsArgs() *StopTrackingHeapObjectsArgs
NewStopTrackingHeapObjectsArgs initializes StopTrackingHeapObjectsArgs with the required arguments.
func (*StopTrackingHeapObjectsArgs) SetCaptureNumericValue ¶ added in v0.33.0
func (a *StopTrackingHeapObjectsArgs) SetCaptureNumericValue(captureNumericValue bool) *StopTrackingHeapObjectsArgs
SetCaptureNumericValue sets the CaptureNumericValue optional argument. If true, numerical values are included in the snapshot
func (*StopTrackingHeapObjectsArgs) SetExposeInternals ¶ added in v0.35.0
func (a *StopTrackingHeapObjectsArgs) SetExposeInternals(exposeInternals bool) *StopTrackingHeapObjectsArgs
SetExposeInternals sets the ExposeInternals optional argument. If true, exposes internals of the snapshot.
Note: This property is experimental.
func (*StopTrackingHeapObjectsArgs) SetReportProgress ¶
func (a *StopTrackingHeapObjectsArgs) SetReportProgress(reportProgress bool) *StopTrackingHeapObjectsArgs
SetReportProgress sets the ReportProgress optional argument. If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
func (*StopTrackingHeapObjectsArgs) SetTreatGlobalObjectsAsRoots
deprecated
added in
v0.26.0
func (a *StopTrackingHeapObjectsArgs) SetTreatGlobalObjectsAsRoots(treatGlobalObjectsAsRoots bool) *StopTrackingHeapObjectsArgs
SetTreatGlobalObjectsAsRoots sets the TreatGlobalObjectsAsRoots optional argument.
Deprecated: Deprecated in favor of `exposeInternals`.
type TakeHeapSnapshotArgs ¶
type TakeHeapSnapshotArgs struct {
ReportProgress *bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
// TreatGlobalObjectsAsRoots is deprecated.
//
// Deprecated: If true, a raw snapshot without artificial roots will
// be generated. Deprecated in favor of `exposeInternals`.
TreatGlobalObjectsAsRoots *bool `json:"treatGlobalObjectsAsRoots,omitempty"`
CaptureNumericValue *bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot
// ExposeInternals If true, exposes internals of the snapshot.
//
// Note: This property is experimental.
ExposeInternals *bool `json:"exposeInternals,omitempty"`
}
TakeHeapSnapshotArgs represents the arguments for TakeHeapSnapshot in the HeapProfiler domain.
func NewTakeHeapSnapshotArgs ¶
func NewTakeHeapSnapshotArgs() *TakeHeapSnapshotArgs
NewTakeHeapSnapshotArgs initializes TakeHeapSnapshotArgs with the required arguments.
func (*TakeHeapSnapshotArgs) SetCaptureNumericValue ¶ added in v0.33.0
func (a *TakeHeapSnapshotArgs) SetCaptureNumericValue(captureNumericValue bool) *TakeHeapSnapshotArgs
SetCaptureNumericValue sets the CaptureNumericValue optional argument. If true, numerical values are included in the snapshot
func (*TakeHeapSnapshotArgs) SetExposeInternals ¶ added in v0.35.0
func (a *TakeHeapSnapshotArgs) SetExposeInternals(exposeInternals bool) *TakeHeapSnapshotArgs
SetExposeInternals sets the ExposeInternals optional argument. If true, exposes internals of the snapshot.
Note: This property is experimental.
func (*TakeHeapSnapshotArgs) SetReportProgress ¶
func (a *TakeHeapSnapshotArgs) SetReportProgress(reportProgress bool) *TakeHeapSnapshotArgs
SetReportProgress sets the ReportProgress optional argument. If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
func (*TakeHeapSnapshotArgs) SetTreatGlobalObjectsAsRoots
deprecated
added in
v0.26.0
func (a *TakeHeapSnapshotArgs) SetTreatGlobalObjectsAsRoots(treatGlobalObjectsAsRoots bool) *TakeHeapSnapshotArgs
SetTreatGlobalObjectsAsRoots sets the TreatGlobalObjectsAsRoots optional argument.
Deprecated: If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of `exposeInternals`.