service

package
v3.15.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecvMetricValues

func RecvMetricValues(sourceMetrics []*cmodel.MetricValue, reply *cmodel.TransferResponse, from string) error

process new metric values

Types

type RelayDelegatee

type RelayDelegatee interface {
	Accept(*cmodel.MetaData) bool
	RelayToQueue() int
	Clone() RelayDelegatee
}

This interface used by "RelayStation"

type RelayFunc

type RelayFunc func(mapToMetrics []*cmodel.MetaData)

This interface is used by "QueryRelay".

type RelayStation

type RelayStation struct {
	// All of the metrics would be fed into "Accept(*MetaData)" in this bucket
	Any []RelayDelegatee
	// If a metric fit("Accept(*MetaData)" returns "true"), it would be consumed
	Exclusive []RelayDelegatee
	// All of the metrics which are not consumed by "Exclusive" bucket, would be sent to this bucket
	Otherwise []RelayDelegatee
}

This object handles the input metric and try to dispatch metric to corresponding RelayDelegatees.

func (*RelayStation) Dispatch

func (r *RelayStation) Dispatch(metaMetric *cmodel.MetaData)

func (*RelayStation) RelayToQueue

func (r *RelayStation) RelayToQueue()

type RelayStationFactory

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

This factory is used to build independent instance of "*RelayStation", which is "CLONED" by pre-defined one.

var DefaultRelayStationFactory *RelayStationFactory

func NewRelayFactoryByGlobalConfig

func NewRelayFactoryByGlobalConfig(config *g.GlobalConfig) *RelayStationFactory

Builds "*RelayStationFactory" from instance of "*g.GlobalConfig"

func (*RelayStationFactory) Build

func (f *RelayStationFactory) Build() *RelayStation

Jump to

Keyboard shortcuts

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