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, start time.Time)
- 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 {
// contains filtered or unexported fields
}
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)
func (*RequestStats) NumStats ¶ added in v1.0.2
func (s *RequestStats) NumStats() int
func (*RequestStats) RecordStat ¶ added in v1.0.2
func (s *RequestStats) RecordStat(stat Stat)
Click to show internal directories.
Click to hide internal directories.