Documentation
¶
Index ¶
- func BlankContextWithRequestStats(parent context.Context) context.Context
- func ContextWithTagCrumb(ctx context.Context, crumb string) context.Context
- func RecordStat(ctx context.Context, store string, tag string, duration time.Duration)
- func RequestStatsMiddleware(next http.Handler) http.Handler
- type RequestStats
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlankContextWithRequestStats ¶ added in v0.32.2
Returns a blank context with only parent's existing *RequestStats (if present).
func ContextWithTagCrumb ¶ added in v0.27.0
Returns a new context with given crumb appended to existing tag, if present. Otherwise, tracks the new tag in returned context. Useful for adding breadcrumbs to a Stat prior to a recording it.
func RecordStat ¶ added in v0.27.0
Append a new Stat to the RequestStats obj in provided context, if present.
Types ¶
type RequestStats ¶
type RequestStats struct {
Stats []Stat
}
func GetRequestStatsFromContext ¶ added in v0.27.0
func GetRequestStatsFromContext(ctx context.Context) *RequestStats
Get RequestStats from ctx, if present.
func (*RequestStats) MarshalZerologObject ¶
func (s *RequestStats) MarshalZerologObject(e *zerolog.Event)
Click to show internal directories.
Click to hide internal directories.