Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enter ¶
func Enter(fnName string)
Enter adds a new nested function call to the profile linked to the current go-routine ID.
func Init ¶
Init handles the initialization of the prism profiler. This method must be called before invoking any other method from this package.
Types ¶
type CallMetrics ¶
type CallMetrics struct { FnName string `json:"fn"` // Total time spent in this call. TotalTime time.Duration `json:"total_time"` // Min and max time. MinTime time.Duration `json:"min_time"` MaxTime time.Duration `json:"max_time"` // Mean and median time. MeanTime time.Duration `json:"mean_time"` MedianTime time.Duration `json:"median_time"` // Percentiles. P50Time time.Duration `json:"p50_time"` P75Time time.Duration `json:"p75_time"` P90Time time.Duration `json:"p90_time"` P99Time time.Duration `json:"p99_time"` // Std of time valus. StdDev float64 `json:"std_dev"` // The number of times a scope was entered by the same parent function call. Invocations int `json:"invocations"` NestedCalls []*CallMetrics `json:"calls"` }
CallMetrics encapsulates all collected metrics about a function call that is reachable by a profile target.
type Profile ¶
type Profile struct { ID uint64 `json:"-"` CreatedAt time.Time `json:"-"` Label string `json:"label"` Target *CallMetrics `json:"target"` }
Profile wraps the processed metrics for a particular execution of a prism-hooked target.
type Sink ¶
type Sink interface { // Initialize the sink input channel with the specified buffer capacity. Open(inputBufferSize int) error // Shutdown the sink. Close() error // Get a channel for piping profile entries to the sink. Input() chan<- *Profile }
Sink defines an interface for processing profile entries emitted by the profiler.
Click to show internal directories.
Click to hide internal directories.