stats

package
v0.0.0-...-2b4093a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS   = "status_code"
	METHOD   = "method"
	PATH     = "path"
	INBYTES  = "recv_bytes"
	OUTBYTES = "send_bytes"
)

Stats key name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	StatusCode string
	Method     string
	Path       string
	InBytes    uint64
	OutBytes   uint64
}

Data is used for holding one record.

type Stats

type Stats struct {
	sync.RWMutex
	StatusCode map[string]uint64
	Method     map[string]uint64
	Path       map[string]uint64
	InBytes    uint64
	OutBytes   uint64
}

Stats is the data container.

func New

func New() *Stats

New returns a Stats object.

func (*Stats) Inc

func (s *Stats) Inc(d *Data)

Inc adds the data.

func (*Stats) String

func (s *Stats) String() string

Jump to

Keyboard shortcuts

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