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 Agent ¶
type Agent interface {
ValueType() ValueType
Fetch(ctx context.Context) (value float64, err error)
}
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
func (*Collector) Register ¶
func (c *Collector) Register(k collectorKey, a Agent, s *Store, nodeName string, interval time.Duration, timeout time.Duration)
func (*Collector) Unregister ¶
func (c *Collector) Unregister(k collectorKey)
type MetricData ¶
type MetricData struct {
InletTemp float64
InletTempTimestamp time.Time
DeltaPressure float64
DeltaPressureTimestamp time.Time
}
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.
Click to show internal directories.
Click to hide internal directories.