profiler

package
v0.0.0-...-31d38a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishHandler

func FinishHandler(next http.Handler) http.Handler

func StartHandler

func StartHandler(next http.Handler) http.Handler

Types

type Hit

type Hit struct {
	ID     string
	Status int
	Route  uint64

	R *h.Request

	Ts *time.Time
	Tf *time.Time
	D  *time.Duration
}

type Hits

type Hits map[string][]*Hit

func (Hits) Filter

func (s Hits) Filter(fn func(k string, v *Hit) bool) Hits

func (Hits) Len

func (h Hits) Len() int

func (Hits) Less

func (h Hits) Less(i, j int) bool

func (Hits) Swap

func (h Hits) Swap(i, j int)

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

func New

func New() *Profiler

func (*Profiler) Hit

func (p *Profiler) Hit(r *h.Request) (h *Hit)

func (*Profiler) Hits

func (p *Profiler) Hits(s Sort) Hits

func (*Profiler) Purge

func (p *Profiler) Purge(f *PurgeFilter)

func (*Profiler) Push

func (p *Profiler) Push(h *Hit) (id string)

type PurgeFilter

type PurgeFilter struct {
	RouteID uint64
}

type Sort

type Sort struct {
	Hit  string
	Path string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL