monitor

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryMS = "MS"

	KindClient = "CLIENT"
	KindServer = "SERVER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	Avg       float64 `json:"avg_ms"`
	Sum       float64 `json:"sum_ms"`
	Range50   int64   `json:"range_50_ms,omitempty"`
	Range100  int64   `json:"range_50_100_ms,omitempty"`
	Range200  int64   `json:"range_100_200_ms,omitempty"`
	Range300  int64   `json:"range_200_300_ms,omitempty"`
	Range400  int64   `json:"range_300_400_ms,omitempty"`
	Range500  int64   `json:"range_400_500_ms,omitempty"`
	Range800  int64   `json:"range_500_800_ms,omitempty"`
	Range1200 int64   `json:"range_800_1200_ms,omitempty"`
	Range1600 int64   `json:"range_1200_1600_ms,omitempty"`
	Range2000 int64   `json:"range_1600_2000_ms,omitempty"`
	RangeInf  int64   `json:"range_2000_ms,omitempty"`
}

type Endpoint

type Endpoint struct {
	ServiceName   string `json:"service"`
	InterfaceName string `json:"interface"`
	Method        string `json:"method"`
	Path          string `json:"path"`
}

type Invocation

type Invocation struct {
	SumAmount    int64        `json:"sum_amount"`
	StatusCode   []StatusCode `json:"status_code"`
	StatusSerial StatusSerial `json:"status_serial"`
	Duration     Duration     `json:"duration"`
}

type MetricItem

type MetricItem struct {
	Cateory    string     `json:"category"`
	Kind       string     `json:"kind"`
	Timestamp  int64      `json:"timestamp"`
	Period     int64      `json:"period"`
	Local      *Endpoint  `json:"local,omitempty"`
	Remote     *Endpoint  `json:"remote,omitempty"`
	Invocation Invocation `json:"invocation"`
}

type Monitor

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

func New

func New() *Monitor

type Stat

type Stat struct {
	Begin      time.Time
	End        time.Time
	Category   string
	Kind       string
	Local      *Endpoint
	Remote     *Endpoint
	StatusCode int
}

func NewStat

func NewStat(category string, kind string, local *Endpoint, remote *Endpoint) *Stat

func (*Stat) HashCode

func (s *Stat) HashCode() string

func (*Stat) Record

func (s *Stat) Record(statusCode int)

type StatusCode

type StatusCode struct {
	Code   string `json:"code"`
	Amount int64  `json:"amount"`
}

type StatusSerial

type StatusSerial struct {
	Informational int `json:"informational"`
	Successful    int `json:"successful"`
	Redirection   int `json:"redirection"`
	ClientErr     int `json:"client_error"`
	ServerErr     int `json:"server_error"`
	ConnErr       int `json:"connect_error"`
	Timeout       int `json:"timeout_error"`
	Unavailable   int `json:"unavailable_error"`
	OtherErr      int `json:"other_error"`
}

Jump to

Keyboard shortcuts

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