Documentation ¶
Index ¶
Constants ¶
View Source
const ( ValueInletTemperature = "inlet_temp" ValueDeltaPressure = "delta_p" )
View Source
const MinInterval = 1 * time.Second
Variables ¶
View Source
var ValueTypes = []ValueType{ ValueInletTemperature, ValueDeltaPressure, }
Functions ¶
func CollectorKey ¶
func CollectorKey(objKey types.NamespacedName, valueType ValueType) collectorKey
func StoreKey ¶
func StoreKey(namespace, name string, info provider.CustomMetricInfo) storeKey
StoreKey constructs a storeKey.
Format: {namespace}/{resource.group}/{name} Examples:
- Pod: "default/pods/pod0"
- Node: "/nodes/node0"
- Deployment: "default/deployments.apps/deploy0"
NOTE: CustomMetricInfo should be normalized with CustomMetricInfo.Normalized().
func StoreKeyForNode ¶
func StoreKeyForNode(name string) storeKey
StoreKeyForNode constructs a storeKey for the given node name.
Format: nodes/{name}
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
func (*Collector) Unregister ¶
func (c *Collector) Unregister(k collectorKey)
type MetricData ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Get ¶
func (s *Store) Get(k storeKey) (MetricData, bool)
Get returns a MetricData for the given storeKey. Thread-safe.
func (*Store) GetOrInit ¶
func (s *Store) GetOrInit(k storeKey) MetricData
GetOrInit returns a MetricData for the given storeKey or inits it if not found. Thread-safe.
func (*Store) Set ¶
func (s *Store) Set(k storeKey, m MetricData)
Set sets a MetricData. Thread-safe.
Click to show internal directories.
Click to hide internal directories.