metrics

package
v3.9.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 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 ContainerID

type ContainerID string

ContainerID is some type of unique id for containers

type DatapointCache

type DatapointCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DatapointCache holds an up to date copy of datapoints pertaining to the cluster. It is updated whenever the HandleAdd method is called with new K8s resources.

func NewDatapointCache

func NewDatapointCache(useNodeName bool) *DatapointCache

NewDatapointCache creates a new clean cache

func (*DatapointCache) AllDatapoints

func (dc *DatapointCache) AllDatapoints() []*datapoint.Datapoint

AllDatapoints returns all of the cached datapoints.

func (*DatapointCache) AllDimProperties

func (dc *DatapointCache) AllDimProperties() []*atypes.DimProperties

AllDimProperties returns any dimension properties pertaining to the cluster

func (*DatapointCache) DeleteByKey

func (dc *DatapointCache) DeleteByKey(key interface{})

DeleteByKey delete a cache entry by key. The supplied interface MUST be the same type returned by Handle[Add|Delete]. MUST HOLD LOCK!

func (*DatapointCache) HandleAdd

func (dc *DatapointCache) HandleAdd(newObj runtime.Object) interface{}

HandleAdd accepts a new (or updated) object and updates the datapoint/prop cache as needed. MUST HOLD LOCK!!

func (*DatapointCache) HandleDelete

func (dc *DatapointCache) HandleDelete(oldObj runtime.Object) interface{}

HandleDelete accepts an object that has been deleted and removes the associated datapoints/props from the cache. MUST HOLD LOCK!!

Jump to

Keyboard shortcuts

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