Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new Context that carries the provided Timer
Types ¶
type Timer ¶
type Timer interface { // Close cleans up all resources associated with the Timer. If any pending metrics // have not been reported, close will flush the result out. Close() // contains filtered or unexported methods }
Timer provides methods for timing methods. Typical Usage scenario:
timer := metrics.GetTimer() defer timer.Close() ctx := metrics.NewContext(ctx, timer) ctx, close := metrics.NewParent(ctx) defer close() close1 := metrics.NewChild(ctx, "Ingest #1") // Perform Ingest #1 call close1() close2 := metrics.NewChild(ctx, "Ingest #2") // Perform Ingest #2 call close2()
Click to show internal directories.
Click to hide internal directories.