Documentation ¶
Index ¶
- Constants
- Variables
- func CodeLineFromRedis(red *redis.Client, m *Monitor, prefix, gaugeName, path string, ...) (seriesData []uint64, codeSeriesData map[codes.Code][]uint64, err error)
- func GaugeLineFromRedis(red *redis.Client, m *Monitor, prefix, gaugeName string, axisData []string) (seriesData []uint64, err error)
- type CodeInfo
- type Gauge
- type Info
- type Item
- type Itp
- type ItpCode
- type ItpCodeGroup
- type ItpGroup
- type Monitor
- func (m *Monitor) Add(gauge, path string, code codes.Code, delta uint64) (newValue uint64, exists bool)
- func (m *Monitor) AddGauge(gauge string, delta uint64) (newValue uint64, exists bool)
- func (m *Monitor) AddWithStatus(gauge, path string, sts *components.Status, delta uint64) (newValue uint64, exists bool)
- func (m *Monitor) Info() *MonitorInfo
- func (m *Monitor) Path(path, name string) *Monitor
- func (m *Monitor) WithStorage(s Storage) *Monitor
- type MonitorInfo
- type Options
- type Storage
Constants ¶
View Source
const ( GaugeRequestCount = `requestCount` GaugeResponseCount = `responseCount` GaugeRequestLen = `requestLen` GaugeResponseLen = `responseLen` GaugePanicCount = `panicCount` )
Variables ¶
View Source
var ( PipeTimeout = time.Second * 3 StorageLifetime = time.Hour * 24 * 7 )
View Source
var ( DefaultOptions = func() Options { return Options{ Name: "bm", Gauges: []string{GaugePanicCount}, CodeGauges: []string{GaugeRequestCount, GaugeResponseCount, GaugeRequestLen, GaugeResponseLen}, ResetSeconds: defaultResetSeconds, ResetTimes: defaultResetTimes, CodeList: []codes.Code{ utils.OK, utils.CodeCanceled, utils.CodeUnknown, utils.CodeInvalidArgument, utils.CodeDeadlineExceeded, utils.CodeNotFound, utils.CodeAlreadyExists, utils.CodePermissionDenied, utils.CodeResourceExhausted, utils.CodeFailedPrecondition, utils.CodeAborted, utils.CodeOutRange, utils.CodeUnimplemented, utils.CodeInternal, utils.CodeUnavailable, utils.CodeDataLoss, utils.CodeUnauthenticated, }, } } )
View Source
var (
RootPath = `/`
)
View Source
var (
Seperator byte = '-'
)
Functions ¶
func CodeLineFromRedis ¶
Types ¶
type Info ¶
type Item ¶
type Itp ¶
type Itp struct { Gauge // contains filtered or unexported fields }
Itp Increment of time period,某个时间段增量
type ItpCode ¶
type ItpCode struct {
// contains filtered or unexported fields
}
ItpCode Increment of time period code,某个时间段状态码增量
func (*ItpCode) AddWithStatus ¶
type ItpCodeGroup ¶
type ItpCodeGroup struct {
// contains filtered or unexported fields
}
ItpCodeGroup Increment of time period group,某个时间段状态码增量组,按照路径划分
func NewItpCodeGroup ¶
func NewItpCodeGroup(name string, codeList []codes.Code) *ItpCodeGroup
func (*ItpCodeGroup) Info ¶
func (icg *ItpCodeGroup) Info() (info []CodeInfo)
func (*ItpCodeGroup) Path ¶
func (icg *ItpCodeGroup) Path(path, name string) *ItpCodeGroup
func (*ItpCodeGroup) Reset ¶
func (icg *ItpCodeGroup) Reset(times int)
type ItpGroup ¶
type ItpGroup struct {
// contains filtered or unexported fields
}
func NewItpGroup ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewMonitor ¶
func (*Monitor) AddWithStatus ¶
func (*Monitor) Info ¶
func (m *Monitor) Info() *MonitorInfo
func (*Monitor) WithStorage ¶
type MonitorInfo ¶
type Options ¶
type Options struct { Name string `json:"name" yaml:"name"` Gauges []string `json:"gauges" yaml:"gauges"` CodeGauges []string `json:"CodeGauges" yaml:"CodeGauges"` ResetSeconds int `json:"resetSeconds" yaml:"resetSeconds"` ResetTimes int `json:"resetTimes" yaml:"resetTimes"` CodeList []codes.Code `json:"codeList" yaml:"codeList"` }
type Storage ¶
type Storage func(info *MonitorInfo) error
func RedisStorage ¶
func RedisStorage(red *redis.Client) Storage
Click to show internal directories.
Click to hide internal directories.