stats

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// Last records for specific app with limits
	LastByUID(uid string, limit int) ([]Record, error)
	// Last all records
	Last(limit int) ([]Record, error)
}

Reader from tracking systems. All returned records should be sorted from newest to oldest (by insertion moment)

type Record

type Record struct {
	UID     string        `json:"uid" msg:"uid,omitempty"`             // app UID
	Err     string        `json:"error,omitempty" msg:"err,omitempty"` // optional error
	Request types.Request `json:"request" msg:"req,omitempty"`         // incoming request
	Begin   time.Time     `json:"begin" msg:"beg,omitempty"`           // started time
	End     time.Time     `json:"end" msg:"end,omitempty"`             // ended time
}

Tracking record

func (*Record) DecodeMsg

func (z *Record) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Record) EncodeMsg

func (z *Record) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Record) MarshalMsg

func (z *Record) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Record) Msgsize

func (z *Record) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Record) UnmarshalMsg

func (z *Record) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Recorder

type Recorder interface {
	// Track single recorder
	Track(record Record)
}

Recorder for apps requests

type Stats

type Stats interface {
	Recorder
	Reader
}

Directories

Path Synopsis
impl
memlog
Code generated by ring-buffer-gen.
Code generated by ring-buffer-gen.

Jump to

Keyboard shortcuts

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