Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultMemorySnapshotInterval is the default interval for taking memory snapshots DefaultMemorySnapshotInterval = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionStrategy ¶
type ActionStrategy interface { Before() After() GetMetrics() *Metrics }
type DefaultStrategy ¶
type DefaultStrategy struct {
// contains filtered or unexported fields
}
func (*DefaultStrategy) After ¶
func (d *DefaultStrategy) After()
func (*DefaultStrategy) Before ¶
func (d *DefaultStrategy) Before()
func (*DefaultStrategy) GetMetrics ¶
func (d *DefaultStrategy) GetMetrics() *Metrics
type FunctionContext ¶
type FunctionContext struct {
// contains filtered or unexported fields
}
func (*FunctionContext) Execute ¶
func (f *FunctionContext) Execute()
type MemorySnapshot ¶
type Metrics ¶
type Metrics struct { StartTime time.Time FinishTime time.Time ExecutionDuration time.Duration Snapshots []MemorySnapshot MinAllocMemory uint64 MaxAllocMemory uint64 AvgAllocMemory uint64 }
func Trace ¶
func Trace(f func(), setters ...TraceOptionSetter) (*Metrics, error)
type TraceOptionSetter ¶
type TraceOptionSetter func(opts *TraceOptions)
func WithAfter ¶
func WithAfter(a func()) TraceOptionSetter
func WithBefore ¶
func WithBefore(b func()) TraceOptionSetter
func WithStrategy ¶
func WithStrategy(s ActionStrategy) TraceOptionSetter
type TraceOptions ¶
type TraceOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.