coordinator

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

Coordinator periodically re balance all replicates

func NewCoordinator

func NewCoordinator(
	shardManager shard.Manager,
	maxSeries int64,
	maxShard int32,
	maxIdleTime time.Duration,
	period time.Duration,
	getConfigMd5 func() string,
	getExploreResult func(hash uint64) *target.ScrapeStatus,
	getActive func() map[uint64]*discovery.SDTargets,
	log logrus.FieldLogger) *Coordinator

NewCoordinator create a new coordinator service

func (*Coordinator) LastGlobalScrapeStatus added in v0.0.5

func (c *Coordinator) LastGlobalScrapeStatus() map[uint64]*target.ScrapeStatus

LastGlobalScrapeStatus return the last scraping status of last coordinate

func (*Coordinator) Run

func (c *Coordinator) Run(ctx context.Context) error

Run do coordinate periodically until ctx done

type Service added in v0.0.3

type Service struct {
	// gin.Engine is the gin engine for handle http request
	*gin.Engine
	// contains filtered or unexported fields
}

Service is the api server of coordinator

func NewService added in v0.0.3

func NewService(
	cfgManager *prom.ConfigManager,
	getScrapeStatus func() map[uint64]*target.ScrapeStatus,
	getActiveTargets func() map[string][]*discovery.SDTargets,
	getDropTargets func() map[string][]*discovery.SDTargets,
	lg logrus.FieldLogger) *Service

NewService return a new web server

Jump to

Keyboard shortcuts

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