tracer

package module
v0.0.0-...-7a9ceba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpCallGraphDOT

func DumpCallGraphDOT(outputFile string) error

DumpCallGraphDOT now includes CPU and memory data in the visualization.

func RecordEntry

func RecordEntry(functionName string)

RecordEntry creates a new TraceRecord, pushes it onto the call stack, and tracks memory before execution.

func RecordExit

func RecordExit(functionName string, startTime time.Time)

RecordExit finalizes the TraceRecord and aggregates it.

Types

type TraceRecord

type TraceRecord struct {
	UniqueID     int64             `json:"uniqueId"`
	FunctionName string            `json:"functionName"`
	CallerID     int64             `json:"callerId,omitempty"`
	EntryTime    time.Time         `json:"entryTime"`
	ExitTime     time.Time         `json:"exitTime"`
	Duration     time.Duration     `json:"duration"`
	CPUTime      time.Duration     `json:"cpuTime"`
	Params       map[string]string `json:"params,omitempty"`
	ReturnValues []string          `json:"returnValues,omitempty"`
	MemBefore    uint64            `json:"memBefore"`
	MemAfter     uint64            `json:"memAfter"`
	MemIncrease  uint64            `json:"memIncrease"`
	PanicValue   interface{}       `json:"panicValue,omitempty"`
	StackTrace   string            `json:"stackTrace,omitempty"`
}

TraceRecord holds detailed trace information for a function call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL