watch

package
v1.20.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterWatcher

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

ClusterWatcher cluster watcher

func NewClusterWatcher

func NewClusterWatcher(pCtx context.Context,
	clusterID string, storage storage.Storage, zk zk.Zk, config *config.Config) *ClusterWatcher

NewClusterWatcher create cluster watcher

func (*ClusterWatcher) Start

func (cw *ClusterWatcher) Start(event chan *MetricEvent)

Start start watcher

func (*ClusterWatcher) Stop

func (cw *ClusterWatcher) Stop()

Stop stop watcher

type EventType

type EventType int

EventType event type

const (
	// EventMetricUpd metric update event
	EventMetricUpd EventType = iota
	// EventMetricDel metric delete event
	EventMetricDel
	// EventDynamicUpd dynamic update event
	EventDynamicUpd
)

func (EventType) String

func (et EventType) String() string

type MetricEvent

type MetricEvent struct {
	ID     string
	Type   EventType
	Metric *types.Metric
	First  bool
	Last   bool
	Meta   map[string]btypes.ObjectMeta
}

MetricEvent metric event

type StorageApplicationIf

type StorageApplicationIf struct {
	Data string `json:"data"`
}

StorageApplicationIf storage application struct

type StorageCollectorIf

type StorageCollectorIf struct {
	Data *types.ApplicationCollectorCfg `json:"data"`
}

StorageCollectorIf storage collector struct

type StorageMetricIf

type StorageMetricIf struct {
	ID   string        `json:"_id"`
	Data *types.Metric `json:"data"`
}

StorageMetricIf store metric struct

type Watcher

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

Watcher watcher for storage

func NewWatcher

func NewWatcher(storage storage.Storage, zk zk.Zk, config *config.Config) *Watcher

NewWatcher create watcher

func (*Watcher) Start

func (w *Watcher) Start() chan *MetricEvent

Start start watcher

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stop watcher

Jump to

Keyboard shortcuts

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