monitor

package
v0.0.0-...-26b160e Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

@Time : 2019/4/23 15:48 @Author : kenny zhu @File : common.go @Software: GoLand @Others:

@Time : 2019/4/23 15:27 @Author : kenny zhu @File : monitor.go @Software: GoLand @Others:

@Time : 2019/4/23 15:37 @Author : kenny zhu @File : options.go @Software: GoLand @Others:

@Time : 2019/4/23 15:42 @Author : kenny zhu @File : os.go @Software: GoLand @Others:

Index

Constants

View Source
const (
	// default ttl value
	HeartBeatTTL   = time.Second * 60
	HeartBeatCheck = time.Second * 15

	// state define here.
	ServiceStatus = "ServiceStatus"
	NormalState   = "normal"
	UpThresh      = "upThresh"
	DownThresh    = "downThresh"

	UpLimits   = int(maxCalls * 0.9)
	DownLimits = int(maxCalls * 0.7)
)

Variables

This section is empty.

Functions

func UpdateServiceWithoutSync

func UpdateServiceWithoutSync(service *registry.Service, weights int)

push heartbeat to service directly..

func WithInterval

func WithInterval(i time.Duration) registry.Option

Interval on which to publish heartbeats

Types

type Heartbeat

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

type Monitor

type Monitor interface {
	Close() error
	GetMonitorRegistry() registry.Registry
	PushHeartBeat(service *registry.Service, weights int)
}

Discovery builds on the registry for heart-beating and client metric all func here.

func NewMonitor

func NewMonitor(newRegistry NewRegistry, opts ...registry.Option) Monitor

this func open heart-beat

type NewRegistry

type NewRegistry func(...registry.Option) registry.Registry

type Options

type Options struct {
	Interval time.Duration
}

Options holds discovery options stored in registry Options context.

Jump to

Keyboard shortcuts

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