stats

package
v0.0.0-...-276be26 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerHeader

func ServerHeader(next echo.HandlerFunc) echo.HandlerFunc

ServerHeader middleware adds a `Server` header to the response.

Types

type RequestStats

type RequestStats struct {
	Count    int                   `json:"count"`
	Statuses map[string]int        `json:"statuses"`
	Records  []*RequestStatsRecord `json:"records,omitempty"`
}

type RequestStatsRecord

type RequestStatsRecord struct {
	Time   time.Time `json:"time"`
	RealIP string    `json:"realIp"`
}

type Stats

type Stats struct {
	Uptime       time.Time                `json:"uptime"`
	RequestCount uint64                   `json:"requestCount"`
	Statuses     map[string]int           `json:"statuses"`
	Requests     map[string]*RequestStats `json:"requests"`
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

func (*Stats) Handle

func (s *Stats) Handle(c echo.Context) error

Handle is the endpoint to get stats.

func (*Stats) Process

func (s *Stats) Process(next echo.HandlerFunc) echo.HandlerFunc

Process is the middleware function.

func (*Stats) StatsIncreaseError

func (s *Stats) StatsIncreaseError(fwdrID string, ctx echo.Context, res *echo.Response)

Jump to

Keyboard shortcuts

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