Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatsCollector ¶
type StatsCollector struct {
// contains filtered or unexported fields
}
func NewStatsCollector ¶
func NewStatsCollector() *StatsCollector
func (*StatsCollector) GetStats ¶
func (sc *StatsCollector) GetStats(reset bool) map[string]map[string]Stats
GetStats returns a snapshot of the current statistics. If reset is true, statistics are cleared after reading.
func (*StatsCollector) Handler ¶
func (sc *StatsCollector) Handler(next http.Handler) http.Handler
Handler returns a middleware that collects timing statistics for the downstream handler chain. It should be attached as close as possible to the actual API logic in the handler chain to measure only the core API logic execution time (excluding upstream middleware).
Click to show internal directories.
Click to hide internal directories.